python - Looking to automate seller login portal with Python and Selenium , find xPath
问题描述
I am looking for xPath for the image that I am inserting.
Below is the code that I wrote, everything is working except click on Login Button.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
browser = webdriver.Chrome('C:\\Users\\byteMe\\Downloads\\chromedriver_win32\chromedriver')
browser.get('https://seller.abc.com/')
browser.find_element_by_id('Final').click()
browser.find_element_by_name('username').send_keys('byteme@gmail.com')
browser.find_element_by_name('password').send_keys('byteme')
browser.find_element_by_xpath("//*[@'button']").click()
browser.get('https://seller.abc.com/index.html#dashboard/listings-management?listingState=ACTIVE')
Inspect element code
解决方案
请尝试以下代码以单击登录按钮
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
submit=WebDriverWait(browser, 10).until(
EC.visibility_of_element_located((By.XPATH, "//button[@class='sc-aewfc iesYjz']//span")))
submit.click()
推荐阅读
- node.js - 如何在 index.js 文件中获取文档 ID 以进行推送通知颤动?
- c++ - 在 Ubuntu 20.04 LTS 上查找 Qt5 时 CMake find_package 失败 - cmake 版本不匹配
- ruby-on-rails - ROR:参数数量错误(给定 2,预期 1)
- html - 引导程序中的导航栏列表对齐问题
- scala - 如何在 Scala 中实现 Levenshtein 距离算法
- angular - Angular routerLink 什么都不做并重定向到主页
- node.js - 不使用 await 异步函数的性能问题
- java - JPA - 辅助表映射方向
- class - 如何处理需要彼此工作的类?
- python - 如何使用 Elementtree python 删除结束标签?