I'm novice in Python and I need to do click on a javascript button, but I don't know how to do it. I wrote this:
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from bs4 import BeautifulSoup
chrome_path= r'C:\Users\fritz\Desktop\python\chromedriver.exe'
browser= webdriver.Chrome(chrome_path)
browser.get('url')
lista=[1503,5789]
for i in lista:
item=browser.find_element_by_name('book')
item=str(i) #write element in the textbox
data=browser.execute_script('Searching') #the javascript button
data=data.click()
soup= BeautifulSoup(data,'html.parser')
The html code is:
<td width="28%" align="right">
<input type="image" src="/web/photo/search_fo.png" alt="Searching"
title="Searching">
</td>
I need to know how I can click on that form and read the data in the next page (opened page by the button). Can you suggest any solution, please?