Parse BeautifulSoup element into Selenium
问题 I want to get the source code of a website using selenium; find a particular element using BeautifulSoup; and then parse it back into selenium as a selenium.webdriver.remote.webelement object. Like so: driver.get("www.google.com") soup = BeautifulSoup(driver.source) element = soup.find(title="Search") element = Selenium.webelement(element) element.click() How can I achieve this? 回答1: A general solution that worked for me is to compute the xpath of the bs4 element, then use that to find the