嘿,我只是在尝试使用Firefox启动一个基本的浏览器。 我试过使用可执行路径,if语句,如果没有if语句,浏览器仍然无法打开。我检查了弹壳,但没找到错误。我的最好的猜测是我错过了某种行动,我只是需要有人指出我在正确的方向使用我目前的代码,谢谢你。你知道吗
from selenium import webdriver
class testbot():
def botfox(self):
driver = self.driver = webdriver.firfox(geckodriver)
driver.get("https://wwww.google.com")
if __name__ == "__botfox__":
botfox()
好的,试试这个:)
如果真能成功我会很惊讶的。你试过通过
testbot().botfox()
叫它吗?你知道吗webdriver.firfox
不起作用,因为语法是webdriver.Firefox
webdriver.firfox(geckodriver)
不起作用,因为geckodriver
在任何地方都没有定义botfox()
将不起作用,因为没有定义这样的函数。在testbot
中有一个类,但是您需要首先实例化该类,然后通过testbot().botfox()
调用它相关问题 更多 >
编程相关推荐