猿问

如何通过 Selenium 和 Python 在 Instagram 中点击“Not Now”按钮

我正在尝试使用我目前正在编写的“instagram bot”登录 Instagram。我已经通过登录屏幕,通过“获取应用程序”屏幕以及它想要如何打开通知。两个选项是“打开”和“现在不”。我正在尝试使用与以前相同的方法单击“现在不”,但它不起作用。代码(在 Firefox 上使用检查元素)说


<button class="aOOlW   HoLwm " tabindex="0">Not Now</button>

我曾尝试使用类代码


notNowButton = driver.find_element_by_xpath("//a[@class='aOOlW HoLwm']")

# or

notNowButton = driver.find_element_by_xpath("//a[@tabindex='0']")

但这也不起作用。有什么帮助吗?


通知:

aluckdog
浏览 161回答 3
3回答
随时随地看视频慕课网APP

相关分类

Python
我要回答