单击网站上的元素/python/webdriver/beautifulsoap

单击网站上的元素/python/webdriver/beautifulsoap,python,beautifulsoup,webdriver,Python,Beautifulsoup,Webdriver,我想使网站上的测试自动化。我在查找/单击元素时遇到问题。试图通过driver.find_(多种组合)和BeautifulSoap找到它 我要单击/选择此元素: Zofia Achmistrowiczwachmistrowicz 尝试: soup=beautifulsou('Zofia AchmistrowiczwachmistrowiczFor automation,使用Selenium。beautifulsou用于解析html。谢谢。我试图通过驱动程序查找它。通过xpath、id、css选择器

我想使网站上的测试自动化。我在查找/单击元素时遇到问题。试图通过
driver.find_(多种组合)
和BeautifulSoap找到它

我要单击/选择此元素:
Zofia Achmistrowiczwachmistrowicz

尝试:
soup=beautifulsou('Zofia AchmistrowiczwachmistrowiczFor automation,使用Selenium。beautifulsou用于解析html。谢谢。我试图通过驱动程序查找它。通过xpath、id、css选择器、部分文本查找,但全部失败。还尝试连接2个驱动程序。通过(id+部分文本)查找.你能帮我通过selenium webdriver找到它吗?@sarasa你能发布真实的站点吗?@aԋ625; 1213;ԃaєιcαη我已经编辑了帖子,请检查
from selenium import webdriver
from csv import DictReader
from bs4 import BeautifulSoup
import re
import lxml
import itertools

#here is irrelevant part

#unable to locate:
#driver.find_element_by_tag_name("listOfTalksName").click()
#driver.find_element_by_link_text("Zofia").click()
#driver.find_element_by_link_text("listOfTalksName").click()
#driver.find_element_by_name("Zofia").click()#driver.find_element_by_css_selector("listOfTalksReaded").click()
#driver.find_element_by_link_text("Zofia Achmistrowiczwachmistrowicz").click()
#driver.find_element_by_xpath('//div[@id="listOfTalksName"]/a[text()="Zofia"]').click()
#result_one = driver.find_element_by_id("listOfTalksReaded")
#result = result_one.find_element_by_name("Zofia").click()
#driver.find_element_by_xpath("//[@class='listOfTalksName'" and text()='Zofia Achmistrowiczwachmistrowicz').click()

#soup = ('<html><body><div id="listOfTalksName"> "Zofia Achmistrowiczwachmistrowicz" </div></body></html')
#soup.find("div", {"id": "listOfTalksName"}).click()
#div = BeautifulSoup.find(id="listOfTalksName").get()
soup = BeautifulSoup('<html><body><div id="listOfTalksName">Zofia Achmistrowiczwachmistrowicz</div></body></html', "html.parser")
print(soup.find_all("div", id=re.compile("^listOfTalksName")))

  [1]: https://i.stack.imgur.com/fdRd2.png