html - Parse resulting webpage Python Selenium -


i used selenium webdriver in python input text in search field , it. i'd parse page/ use beautifulsoup on it. i'm confused how call resulting page.

my code far:

textinput = open("1.txt", "r").read() url = "http://www.example.com" driver = webdriver.chrome(executable_path='path/chromedriver.exe') driver.get(url) sbox = driver.find_element_by_name("a") sbox.send_keys(textinput)  submit = driver.find_element_by_xpath('//*[@id="maincontent"]/form/input[5]') submit.click() 

once have clicked on submit button using:

submit.click() 

it automatically goes next page. so, parse resulting page, make another:

whatimlookingfor = driver.find_element_by_id("myid") 

submit = driver.find_element_by_xpath('//*[@id="maincontent"]/form/input[5]') # still on first page submit.click() # on second page whatimlookingfor = driver.find_element_by_id("myid") 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -