By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,347 Members | 2,091 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,347 IT Pros & Developers. It's quick & easy.

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

P: 1
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
Share this question for a faster answer!
Share on Google+

Post your reply

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