Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Need Help Selecting Element [Selenium C#]

Code
<select class="ui-textfield ui-textfield-system sa-error-field" style="display: inline-block;">

Tried XPath, CSSSelector etc, it always says that it can't find the element. Help would be much appreciated!

Full "outer" code. I'm trying to select the element and use "SelectByValue" to choose the item "London".

PHP Code

<?php 
<div class="sa-form-control sa-form-field sa-select-input sa-province-wrapper" data-widget-cid="widget-14" style="padding-bottom: 20px;">
                <
input name="province" class="ui-textfield ui-textfield-system sa-error-field" style="display: none;" maxlength="64" type="text">
                <
select class="ui-textfield ui-textfield-system sa-error-field" style="display: inline-block;"><option value="">--Please select--</option><option value="Aberdeenshire">Aberdeenshire</option></select>
            <
p class="sa-error-tips" style="display: block;">Please select a State/Province/Region</p></div> 
Are you sure you've written the correct css selector??
Have a cool signature? hit me up and I might use it.
I think you've got a wrong XPath selector. Try this:
Code
//option[@value='Aberdeenshire']
Decomposition:
//: select all
option: select option nodes
[]: node descriptior
@: attribute
value: atribute named value
='(value)': expected value


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Luffy-_-Aug 20, 2023 02:06 AM 12 446 Aug 20, 2023 02:06 AM
Last Post: Lucky4L
[Python] by Don CezarAug 20, 2023 01:37 AM 5 502 Aug 20, 2023 01:37 AM
Last Post: Lucky4L
by darkfantaOct 22, 2022 11:14 AM 6 367 Oct 22, 2022 11:14 AM
Last Post: darkfanta