from selenium import webdriver
path= "C:/Users\KIM/Downloads/chromedriver.exe"
driver = webdriver.Chrome(path)
driver.get('https://komyojikyozo.web.fc2.com')
# Find a frame
iframes = driver.find_elements_by_css_selector('frame')
for iframe in iframes:
print(iframe.get_attribute('name'))
# Switch to frame
driver.switch_to.frame('menu')
#? Why doesn't the page come out when I switched frames?
element = driver.find_element_by_css_selector("a").get_attribute('href')
I'd like to click on that link as a selenium. I keep getting errors whether it's a grammar mistakes. How do I select href = "javascript_:void(0)" for tag a?
<a href="javascript_:void(0)" onclick="changeVis('dnskvmenu', 'dnskvtree')">「戒蘊篇」</a>
Do it like this.
a = 'body > table:nth-child(5) > tbody > tr:nth-child(2) > td:nth-child(1) > div > a'
element = driver.find_element_by_css_selector(a).get_attribute('href')
925 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
577 Who developed the "avformat-59.dll" that comes with FFmpeg?
626 Uncaught (inpromise) Error on Electron: An object could not be cloned
574 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.