SyntaxError: invalid syntax error using xpath with Selenium and Python
SyntaxError: invalid syntax error using xpath with Selenium and Python
我正在编写一个简单的代码,我需要在其中提取 html 标签的内容,该标签是 <span>
。我已经使用 xpath 来做到这一点。
这是错误
File "C:\Users\BRS\Desktop\AccountChef\wattpad acc maker - Copy.py", line 41
emailentry = wd.findElement(By.xpath(//*[@id='email']//span)).getText();
^
SyntaxError: invalid syntax
既然是语法错误,我想我不需要给出完整的代码。
请告诉我做错了什么
我正在编写一个简单的代码,我需要在其中提取 html 标签的内容,该标签是 <span>
。我已经使用 xpath 来做到这一点。
这是错误
File "C:\Users\BRS\Desktop\AccountChef\wattpad acc maker - Copy.py", line 41
emailentry = wd.findElement(By.xpath(//*[@id='email']//span)).getText();
^
SyntaxError: invalid syntax
既然是语法错误,我想我不需要给出完整的代码。 请告诉我做错了什么