Click on any one of "1 2 3 4 5 ..." on a page by using Selenium in Python (e.g., Splinter): -


i have html looks 3 following sample statements:

<a href="javascript:__dopostback('ctl00$formcontent$gvresults','page$10')">...</a>  <a href="javascript:__dopostback('ctl00$formcontent$gvresults','page$12')">12</a>  <a href="javascript:__dopostback('ctl00$formcontent$gvresults','page$13')">13</a> 

(i'd presently on pg. 11.)

i don't know py/selenium/splinter syntax selecting 1 of page numbers in list , clicking on go page. (also, need able identify element in argument as, example, 'page$10' or 'page$12', seen in __dopostback notation. maybe 'next page', in many words, fine, don't know how that.)

thank help.

update ii: here's code have work from:

import time import win32ui import win32api import win32con selenium import webdriver selenium.webdriver.common.keys import keys ctypes import * selenium.webdriver.common.by import   driver = webdriver.chrome() driver.get('http://[site]'); 

update iii:

traceback (most recent call last):   file "montpa_05.py", line 47, in <module>     continue_link = driver.find_element_by_link_text('4')   file "c:\python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", l ine 246, in find_element_by_link_text     return self.find_element(by=by.link_text, value=link_text)   file "c:\python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", l ine 680, in find_element     {'using': by, 'value': value})['value']   file "c:\python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", l ine 165, in execute     self.error_handler.check_response(response)   file "c:\python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py" , line 164, in check_response     raise exception_class(message, screen, stacktrace) selenium.common.exceptions.nosuchelementexception: message: u'no such element\n  (session info: chrome=28.0.1500.95)\n  (driver info: chromedriver=2.2,platform= windows nt 6.1 sp1 x86_64)' 

the <a> element defined link. means can select link text.

i don't know python, java syntax by.linktext(##) ## number want click on.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -