Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Pull Down Menu Problem using Selenium
#1
I trying to click on a Pull down menu from a TV Guide link called
https://tvlistings.zap2it.com/?aid=gapzap

[NOW] I want to click on the NOW Button.

Then a pull down menu is displayed with numerous times for the TV guide. Example

1:00 PM
2:00 PM
3:00 PM
4:00 PM
5:00 PM
6:00 PM

I wan to select: 5:00 PM

I'm having no success.

import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException
driver = webdriver.Chrome(executable_path='D:\SeleniumGuide\chromedriver2.exe')
driver.implicitly_wait(30)
driver.maximize_window()
driver.get("https://tvlistings.zap2it.com/?aid=gapzap")
#driver.find_element_by_xpath("//button[@class='fa fa-map-marker']").click() Not working
#driver.find_elements_by_class_name("btn btn-default dropdown-toggle").click() Not working
#driver.find_element_by_css_selector("btn btn-default dropdown-toggle").click() Not working
#driver.find_element_by_xpath("//*[@class='btn btn-default dropdown-toggle']").click()Not working
#driver.find_element_by_link_text("Now").click() Not working



Here is the HTML for the drop down menu

<button class="btn btn-default dropdown-toggle" type="button" id="jump-to-time" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<!-- react-text: 195 -->Now<!-- /react-text --><!-- react-text: 196 -->&nbsp; <!-- /react-text --><span class="caret"></span></button>
<ul class="dropdown-menu" aria-labelledby="jump-to-time"><li><a href="#"><!-- react-text: 201 --> <!-- /react-text --><!-- react-text: 202 -->Now<!-- /react-text --><!-- react-text: 203 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 206 --> <!-- /react-text --><!-- react-text: 207 -->Primetime<!-- /react-text --><!-- react-text: 208 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 211 --> <!-- /react-text --><!-- react-text: 212 -->Daytime<!-- /react-text --><!-- react-text: 213 --> <!-- /react-text --></a></li><li role="separator" class="divider"></li><li><a href="#"><!-- react-text: 217 --> <!-- /react-text --><!-- react-text: 218 -->12:00 am<!-- /react-text --><!-- react-text: 219 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 222 --> <!-- /react-text --><!-- react-text: 223 -->1:00 am<!-- /react-text --><!-- react-text: 224 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 227 --> <!-- /react-text --><!-- react-text: 228 -->2:00 am<!-- /react-text --><!-- react-text: 229 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 232 --> <!-- /react-text --><!-- react-text: 233 -->3:00 am<!-- /react-text --><!-- react-text: 234 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 237 --> <!-- /react-text --><!-- react-text: 238 -->4:00 am<!-- /react-text --><!-- react-text: 239 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 242 --> <!-- /react-text --><!-- react-text: 243 -->5:00 am<!-- /react-text --><!-- react-text: 244 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 247 --> <!-- /react-text --><!-- react-text: 248 -->6:00 am<!-- /react-text --><!-- react-text: 249 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 252 --> <!-- /react-text --><!-- react-text: 253 -->7:00 am<!-- /react-text --><!-- react-text: 254 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 257 --> <!-- /react-text --><!-- react-text: 258 -->8:00 am<!-- /react-text --><!-- react-text: 259 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 262 --> <!-- /react-text --><!-- react-text: 263 -->9:00 am<!-- /react-text --><!-- react-text: 264 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 267 --> <!-- /react-text --><!-- react-text: 268 -->10:00 am<!-- /react-text --><!-- react-text: 269 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 272 --> <!-- /react-text --><!-- react-text: 273 -->11:00 am<!-- /react-text --><!-- react-text: 274 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 277 --> <!-- /react-text --><!-- react-text: 278 -->12:00 pm<!-- /react-text --><!-- react-text: 279 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 282 --> <!-- /react-text --><!-- react-text: 283 -->1:00 pm<!-- /react-text --><!-- react-text: 284 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 287 --> <!-- /react-text --><!-- react-text: 288 -->2:00 pm<!-- /react-text --><!-- react-text: 289 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 292 --> <!-- /react-text --><!-- react-text: 293 -->3:00 pm<!-- /react-text --><!-- react-text: 294 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 297 --> <!-- /react-text --><!-- react-text: 298 -->4:00 pm<!-- /react-text --><!-- react-text: 299 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 302 -->
<!-- /react-text --><!-- react-text: 303 -->5:00 pm<!-- /react-text -->
<!-- react-text: 304 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 307 --> <!-- /react-text --><!-- react-text: 308 -->6:00 pm<!-- /react-text --><!-- react-text: 309 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 312 --> <!-- /react-text --><!-- react-text: 313 -->7:00 pm<!-- /react-text --><!-- react-text: 314 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 317 --> <!-- /react-text --><!-- react-text: 318 -->8:00 pm<!-- /react-text --><!-- react-text: 319 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 322 --> <!-- /react-text --><!-- react-text: 323 -->9:00 pm<!-- /react-text --><!-- react-text: 324 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 327 --> <!-- /react-text --><!-- react-text: 328 -->10:00 pm<!-- /react-text --><!-- react-text: 329 --> <!-- /react-text --></a></li><li><a href="#"><!-- react-text: 332 --> <!-- /react-text --><!-- react-text: 333 -->11:00 pm<!-- /react-text --><!-- react-text: 334 --> <!-- /react-text --></a></li></ul>

Can anybody help me.

Thank You
Quote
#2
take a look at number 6 here. Don't know if this will solve your problem, but will point you in the right direction: https://stackoverflow.com/questions/3034...hon-scrapy
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Selenium Webdriver Memory Problem? satbir129 2 277 Mar-01-2019, 04:17 AM
Last Post: satbir129
  pull streams from Twitch with a keyword in title maddensplayers 1 262 Feb-18-2019, 03:19 AM
Last Post: SheeppOSU
  Looping problem using Selenium smk90 0 349 Sep-19-2018, 08:48 PM
Last Post: smk90
  A problem with using selenium Truman 2 1,539 Aug-08-2018, 10:41 PM
Last Post: Truman
  Need help in selenium Lizard 1 1,002 Nov-07-2017, 03:26 PM
Last Post: metulburr
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 937 Nov-03-2017, 08:41 PM
Last Post: metulburr
  Click dropdown menu option with Selenium PyChrome AcszE 3 2,015 Oct-26-2017, 10:07 PM
Last Post: metulburr
  Python Selenium WebDriver Problem SlpnGnt 2 3,193 Apr-01-2017, 10:40 PM
Last Post: SlpnGnt
  Running a selenium test using data from spreadsheet (have problem iterating...) danw32 0 1,025 Mar-07-2017, 12:40 PM
Last Post: danw32

Forum Jump:


Users browsing this thread: 1 Guest(s)