473,413 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

How to select item from drop down list in Selenium Python. In div tag

I have been trying to make a bot that selects an option from a drop down list. The select tag is in a div tag. I have been trying for hours to get it to select the option with 12 in the text, but it doesn't work. I have watched multiple videos and checked stackoverflow for a solution and everything i try wont work. I have imported select and have tried every solution ive found but it doesn't work. If anybody can recommend a solution for this particular code that would be great. maybe since it is wrapped in a div tag the solutions i have been trying aren't working. Thanks in advanced
Expand|Select|Wrap|Line Numbers
  1. <div class="exp-pdp-size-container exp-pdp-dropdown-container nsg-form--drop-down">
  2.    <select name="skuAndSize" class="nsg-form--drop-down exp-pdp-size-dropdown exp-pdp-dropdown two-column-dropdown selectBox" data-tooltiptext="Select a Size" required="required" data-error="Select a Size" data-has-fixed-ancestor="true" style="display: none;">
  3.                             <option class="exp-pdp-size-not-in-stock" value=""></option>
  4.                                 <option class="exp-pdp-size-not-in-stock selectBox-disabled" name="skuId" value="17112685:6" data-label="(6)">
  5.                                                   6
  6.                                 </option>
  7.                                 <option name="skuId" value="17112684:6.5" data-label="(6.5)">
  8.                                                   6.5
  9.                                 </option>
  10.                                 <option name="skuId" value="17112683:7" data-label="(7)">
  11.                                                   7
  12.                                 </option>
  13.                                 <option name="skuId" value="17112682:7.5" data-label="(7.5)">
  14.                                                   7.5
  15.                                 </option>
  16.                                 <option name="skuId" value="17112681:8" data-label="(8)">
  17.                                                   8
  18.                                 </option>
  19.                                 <option name="skuId" value="17112680:8.5" data-label="(8.5)">
  20.                                                   8.5
  21.                                 </option>
  22.                                 <option name="skuId" value="17112679:9" data-label="(9)">
  23.                                                   9
  24.                                 </option>
  25.                                 <option name="skuId" value="17112678:9.5" data-label="(9.5)">
  26.                                                   9.5
  27.                                 </option>
  28.                                 <option name="skuId" value="17112677:10" data-label="(10)">
  29.                                                   10
  30.                                 </option>
  31.                                 <option name="skuId" value="17112693:10.5" data-label="(10.5)">
  32.                                                   10.5
  33.                                 </option>
  34.                                 <option name="skuId" value="17112692:11" data-label="(11)">
  35.                                                   11
  36.                                 </option>
  37.                                 <option name="skuId" value="17112691:11.5" data-label="(11.5)">
  38.                                                   11.5
  39.                                 </option>
  40.                                 <option name="skuId" value="17112690:12" data-label="(12)">
  41.                                                   12
  42.                                 </option>
  43.                                 <option name="skuId" value="17112689:12.5" data-label="(12.5)">
  44.                                                   12.5
  45.                                 </option>
  46.                                 <option name="skuId" value="17112688:13" data-label="(13)">
  47.                                                   13
  48.                                 </option>
  49.                                 <option name="skuId" value="17112687:14" data-label="(14)">
  50.                                                   14
  51.                                 </option>
  52.                                 <option name="skuId" value="17112686:15" data-label="(15)">
  53.                                                   15
  54.                                 </option>
Dec 22 '16 #1
0 1319

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: shlomi.schwartz | last post by:
Hi All, Is it possible to open the select (ComboBox) drop down list by script?
1
by: Paul M | last post by:
Hi folks, When I set the datasource of a dropdown list and bind it, the drop down list always defaults to the first item in the list. I need it to default to Nothing or NULL or whatever it is...
2
by: Eric Dan | last post by:
Hi, Even tough I was able to implement what I want in a weird and non efficient way, I would like to get an opinion what is the right way to achieve my task: Scenario: • Display a DataGrid...
5
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1);...
6
by: nasirmajor | last post by:
Dear all, a simple quetion as usual I have a html select list. e.g <select class="text" name="bmonth" runat="server" id="bmonth"> <option selected="selected" value="0"></option> <option...
0
by: weiwei | last post by:
Hi here is my scenario, I create a drop down list in itemtemplate.(that drop down is created from db), after user click edit command, my ideal plan is have another drop down list in...
2
by: magix | last post by:
I have an drop down list let say: <SELECT name="id" id="id" OnClick="Skip()"> <option value="0"></option> <option value="1">Item 1</option> <option value="2">Item 2</option> <option...
2
by: indhuma | last post by:
Hi, I'm using the following code to show the category = thoughts. I have three categories, when i select thoughts only it has to show the thoughts category. If i select other category it has to...
1
by: Adeel Khan | last post by:
I am creating a Simple JSP page Name Address Telephone Disgination I already have Desgination in my oracle table which i want on this page, so user can select from drop down list.
0
by: StarLavender | last post by:
Hi. I want to create a search form using the drop down list and checkbox. First, the users have to select from drop down list whether they want to search by date or id. After that, for example, a new...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.