Я только что установил Splinter, введите простой код, как показано ниже, но с ошибкой. Может ли кто-нибудь помочь мне в этом? Благодарю.Pinton Splinter issue
from splinter import Browser
b=Browser()
url = "http://www.google.com"
b.visit(url)
Сообщения об ошибках:
Обратное прослеживание (самый последний вызов последнего): Файл "", линия 1, в File «/usr/local/lib/python2.7/dist-packages/splinter/driver/webdriver/init .py ", строка 184, в визите self.driver.get (url) Файл" /usr/local/lib/python2.7/dist-packages/selenium/webdriver/ remote/webdriver.py ", строка 245, в get self.execute (Command.GET, {'url': url}) Файл"/usr/loca l/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py ", строка 233, в исполнении self.error_handler.check_response (response) Файл" /usr/local/lib/python2.7 /dist-packages/selenium/webdriver/remote/errorhandler.py ", строка 194, в check_response raise exception_class (сообщение, экран, stacktrace) selenium.common.exceptions.WebDriverException: Сообщение: целевой URL www.google.ca не является хорошо сформированным. Stacktrace: в FirefoxDriver.prototype.get (файл: ///tmp/tmpsIlz0H/extensions/[email protected]/components/driver-component.js: 10636) на DelayedCommand.prototype.executeInternal_/h (файл:///tmp/tmpsIlz0H/extensions/[email protected]/components/command-processor.js:12661) в DelayedCommand.prototype.executeInternal_ (файл: ///tmp/tmpsIlz0H/extensions/[email protected]/components /command-processor.js:12666) в DelayedCommand.prototype.execute/< (файл: ///tmp/tmpsIlz0H/extensions/[email protected]/components/command-processor.js: 12608)
ли вы установили Firefox? – sousatg
Предоставленный вами код не является тем, который генерировал исключение. Исключение означает, что в предоставленном URL-адресе «www.google.ca» отсутствует протокол «http: //» спереди. –