Python 壁虎河不会开放
我正在尝试使用geckodriver启动FireFox,并访问instagram.com。当我运行我的代码时,它会启动FireFox,但只是在一个空白选项卡上,不会加载instagram。我已经设置了通往geckodriver的路径,并且安装了seleniumPython 壁虎河不会开放,python,selenium,geckodriver,Python,Selenium,Geckodriver,我正在尝试使用geckodriver启动FireFox,并访问instagram.com。当我运行我的代码时,它会启动FireFox,但只是在一个空白选项卡上,不会加载instagram。我已经设置了通往geckodriver的路径,并且安装了selenium from selenium import webdriver from selenium.webdriver.common.keys import Keys import time class InstagramBot:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
class InstagramBot:
def __init__(self, username, password):
self.username = username
self.password = password
self.driver = webdriver.Firefox()
def closeBrowser(self):
self.driver.close()
def login(self):
driver = self.driver
driver.get("https://www.instagram.com/")
time.sleep(2)
# "//a[@href'accounts/login/?source=auth_switcher']"
# "//input[@name='username']"
# "//input[@name='password']"
monchaosIG = InstagramBot("username", "passoword")
monchaosIG.login
这是因为应用程序版本不兼容,您需要安装lasted和Aha!非常感谢你。那对我来说是愚蠢的。容易解决:)不客气。如果解决了,请考虑将答案标记为正确。