Home>
I am a python beginner. I started to use selenium.
Even if you can access the element of thebutton, nothing changes when you click.
Since there was javascript at the time of click in html, I tried to move it, but the situation is the same.
Since selenium itself is taking screenshots, it works properly
think.
driver.save_screenshot ('/ home/sun/screenshot0.png')
#search_box = driver.find_element_by_id ("button_search")
#print (search_box.is_displayed ())
#valString = search_box.get_attribute ("type")
#print (valString)
#valString = search_box.get_attribute ("class")
#print (valString)
#print (search_box.text)
#print (search_box.location)
# search_box.click ()
driver.execute_script ("$('# button_search'). click (function () (var nextPage = 'CattleSearch/search/agreement';window.open (nextPage, '_blank');return false;});")
time.sleep (2)
driver.save_screenshot ('/ home/sun/screenshot1.png')
# search_box.submit ()
# driver.save_screenshot ('/ home/sun/screenshot2.png')
driver.quit ()
$(function () {
// Click to search individual ID number
$('# button_search'). click (function () {
var nextPage = 'CattleSearch/search/agreement';
window.open (nextPage, '_blank');
return false;
});
}
<p><button type = "button">Search for individual identification number</button></p>
-
Answer # 1
-
Answer # 2
Did you use the .click () function?
https://qiita.com/kinpira/items/383b0fbee6bf229ea03d#%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E3%82%AF%E3% 83% AA% E3% 83% 83% E3% 82% AF% E3% 81% 97% E3% 81% A6% E3% 81% BF% E3% 82% 8B
Related articles
- python - [selenium] click the radio button
- python - [selenium] i want to click the dropdown, but an error is returned
- python - about pythinista3 selenium browser controls
- i want to click and number a few images like a switch in python
- python - open another tab of selenium
- python selenium data extraction error
- python - how to get "job description" of hello work with selenium
- [python] i can't open a new firefox tab in selenium a new window will open
- some elements cannot be clicked in python selenium (chrome)
- website button clicks in selenium and python
- click does not respond in javascript
- python - i'm using selenium the text sent by send_keys to the input tag disappears when the text is sent by send_key to the next
- about moving to another page with python selenium
- python - error when scraping with selenium and firefox
- python - selenium: element specification an error occurs in the code that can be executed once
- python - i want to get multiple elements with selenium
- python - in selenium, i want to log in if the chromedriver is not open, and jump directly to the page after login if it is open
- python - i want to use selenium using docker
- how to click only when a specific button is present in python scraping
- python - when i run selenium without headless mode, "~ exited abnormally" is displayed and it does not work
Related questions
- python : Selenium check box sculthood
- Python3 selenium How to pull out the text?
- I can not get the element from XPath at SELENIUM of Python
- python : How to pull out links from all site pages? How to make a pagination in selenium?
- How to get the current value of Selenium, Python3, combo box
- javascript : Selenium cannot find button
- python : Scraping, part of the text being automatically acquired with English translated into English
- python : How to fix this error "UnboundLocalerror: Local Variable 'name_of_lawyer_answer' referented before assignment"?
- How to get DevTools ->Sources via Selenium in Python?
- python : Why gives the Chrome Failed to Start error?
How about it?