导航:首页 > 编程语言 > python代理打不开网页

python代理打不开网页

发布时间:2024-05-13 16:56:58

python 制作网页打不开 直接跳到打开或者保存文件

需要对Lighttpd进行配置,指明py文件是作为cgi程序运行的。
修改配置文件:/etc/lighttpd/lighttpd.conf
在以下小节内添加python内容:
server.moles = ( "mod_cgi", )
cgi.assign = (
".py" => "/usr/bin/python"
)

Ⅱ python鍙浠ョ敤镊锷ㄥ寲镓扑笉寮娴忚埚櫒

闇瑕佷笅杞藉畨瑁単eckodriver, 铹跺悗灏嗗叾锷犲叆鐜澧冨彉閲.
Zidon鍒板崥瀹㈢粰浣犳惉杩囨潵浜

selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
version: selenium==3.0.1
姝ょ増链镓ц岄渶瑕侀┍锷锛欢eckodriver
鍙浠ュ幓缃戝潃https://github.com/mozilla/geckodriver/releases 杩欓噷涓嬭浇链鏂扮殑鐗堟湰銆
铹跺悗灏嗘枃浠跺す瑙e帇鍒癈:\geckodriver澶勶纴鍐嶅炲姞鍦ㄧ数鑴戣剧疆鐜澧冨彉閲忥纴濡备笅锲炬墍绀

铹跺悗鍦ㄥ垱寤篎irefox镄勬椂鍊栾剧疆镓ц岃矾寰
browser = webdriver.Firefox(executable_path = 'C:\geckodriver\geckodriver.exe')
Traceback (most recent call last): File "C:\learnplace\python_webdevelop_testdriver\functional_tests.py", line 10, in <mole>
browser = webdriver.Firefox() File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 135, in __init__ self.service.start() File "C:\Python27\lib\site-packages\selenium\webdriver\common\service.py", line 71, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x00000000030E7CF8>> ignored

涓嶈繃姝ゆ椂浼氩嚭鐜板彟澶栦竴涓寮傚父锛
Traceback (most recent call last): File "C:\learnplace\python_webdevelop_testdriver\functional_tests.py", line 10, in <mole>
browser = webdriver.Firefox(executable_path = 'C:\geckodriver\geckodriver.exe') File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 145, in __init__
keep_alive=True) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 92, in __init__ self.start_session(desired_capabilities, browser_profile) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 179, in start_session
response = self.execute(Command.NEW_SESSION, capabilities) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute
self.error_handler.check_response(response) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line

闇瑕佸皢binary镄勬祻瑙埚櫒璺寰勬坊锷犱互涓
from selenium import webdriverfrom selenium.webdriver.firefox.firefox_binary import FirefoxBinary# browser = webdriver.Firefox(# firefox_binary='C:\Program Files (x86)\Mozilla Firefox')# browser.get('http://localhost:8000')# assert 'Django' in browser.titlebinary = FirefoxBinary(r'C:\Program Files (x86)\Mozilla Firefox\firefox.exe')
browser = webdriver.Firefox(firefox_binary=binary)
browser.get('http://localhost:8000')

涓嶈繃鍙埚嚭鐜颁互涓嫔纾甯搞伞伞
Traceback (most recent call last): File "C:\learnplace\python_webdevelop_testdriver\functional_tests.py", line 18, in <mole>
browser = webdriver.Firefox(firefox_binary=binary) File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 145, in __init__
keep_alive=True) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 92, in __init__ self.start_session(desired_capabilities, browser_profile) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 179, in start_session
response = self.execute(Command.NEW_SESSION, capabilities) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute
self.error_handler.check_response(response) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Unsupported Marionette protocol version 2, required 3

浠ヤ笂闂棰桦彧瑕佹洿鏂癴irefox鍒47鐗堟湰灏卞彲浠ヤ简銆傜粓浜庤В鍐充简銆伞
浣跨敤PhantomJS 镞犲ご娴忚埚櫒
self.browser = webdriver.PhantomJS(executable_path=r'C:\phantomjs\bin\phantomjs.exe')

Ⅲ python爬虫怎么处理豆瓣网页异常请求

1.URLError

首先解释下URLError可能产生的原因:

阅读全文

与python代理打不开网页相关的资料

热点内容
压缩干粮图片 浏览:838
怎么看网站被加密的视频 浏览:848
哪个app可以弄会动的照片模板 浏览:272
如何关闭电脑的时钟源服务器 浏览:902
adb命令设置主屏幕应用 浏览:990
编译后的bak文件 浏览:259
php生成文件名 浏览:880
日照智能车辆移动机器人导航算法 浏览:115
解压力的食疗 浏览:125
密钥如何加密随机数 浏览:381
统计学中pre的算法 浏览:411
inline函数在编译时不做类型检查 浏览:268
经纬度查询android 浏览:762
vivoz5x方舟怎么进服务器 浏览:498
vivox50安卓微信人脸支付怎么开启 浏览:895
cmd退出python命令 浏览:534
恢复u盘加密隐藏的文件 浏览:925
对某个人加密应该用公钥 浏览:1002
机顶盒中央1加密 浏览:98
单片机的出现有什么影响 浏览:232