12306 icon indicating copy to clipboard operation
12306 copied to clipboard

chromium求大神帮忙

Open sunwgd opened this issue 5 years ago • 16 comments

刷新间隔: 随机(1-3S) 僵尸票关小黑屋时长: 5 下单接口: 2 下单模式: 2 预售踩点时间:13:00:00


cookie获取中 Traceback (most recent call last): File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 76, in start stdin=PIPE) File "/home/ubuntu/anaconda3/lib/python3.7/subprocess.py", line 775, in init restore_signals, start_new_session) File "/home/ubuntu/anaconda3/lib/python3.7/subprocess.py", line 1522, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) PermissionError: [Errno 13] Permission denied: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run.py", line 20, in run() File "run.py", line 8, in run select_ticket_info.select().main() File "/home/ubuntu/super_packet/super_pocket/12306/init/select_ticket_info.py", line 155, in main getDrvicesID(self) File "/home/ubuntu/super_packet/super_pocket/12306/config/getCookie.py", line 17, in getDrvicesID driver = webdriver.Chrome(executable_path=TickerConfig.CHROME_PATH) File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in init self.service.start() File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 88, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: '' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

sunwgd avatar Sep 18 '19 04:09 sunwgd

config中chrome driver没填

whitelok avatar Sep 18 '19 06:09 whitelok

ok找到错误,没仔细看config

sunwgd avatar Sep 18 '19 06:09 sunwgd

请问解决了吗,我填完之后,又出现Permission Error

lvztpy avatar Sep 18 '19 08:09 lvztpy

我使用的版本是: Google Chrome 77.0.3865.75 ChromeDriver 77.0.3865.40 在config/getCookie.py添加 from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument("start-maximized"); options.add_argument("disable-infobars"); options.add_argument("--disable-extensions"); options.add_argument("--disable-gpu"); options.add_argument("--disable-dev-shm-usage"); options.add_argument("--no-sandbox"); options.add_argument("--headless"); cookies = [] driver = webdriver.Chrome(executable_path=TickerConfig.CHROME_PATH, options=options)

sunwgd avatar Sep 18 '19 09:09 sunwgd

cookie获取中 init cookie /usr/bin/chromedriver Traceback (most recent call last): File "run.py", line 20, in run() File "run.py", line 8, in run select_ticket_info.select().main() File "/root/demo/12306-master/init/select_ticket_info.py", line 155, in main getDrvicesID(self) File "/root/demo/12306-master/config/getCookie.py", line 19, in getDrvicesID driver = webdriver.Chrome(TickerConfig.CHROME_PATH) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/chrome/webdriver.py", line 75, in init desired_capabilities=desired_capabilities) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 154, in init self.start_session(desired_capabilities, browser_profile) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

xkaaaaaa avatar Sep 20 '19 01:09 xkaaaaaa

CHROME_PATH配置的不对吧,或者没下载Google Chrome 77.0.3865.75-ChromeDriver 77.0.3865.40

sunwgd avatar Sep 20 '19 02:09 sunwgd

https://hub.docker.com/r/joyzoursky/python-chromedriver;用这个基础镜像吧

quany avatar Sep 21 '19 10:09 quany

首先谢谢 phperfan 大侠的帮助很好的完成了 Using TensorFlow backend. 问题。 pip install numpy==1.16.4 和 pip install setuptools==41.0.1,但运行run.py 后 就出现下述的 AttributeError: module 'TickerConfig' has no attribute 'CHROME_PATH'新问题, 求解?昨天只成功了一次,并买到一张票了。 之后就一直无法下单, 最后我今天再次下载testerSunshine 的master 再试,发现如下问题( 我的chrome 升级为版本 77.0.3865.90(正式版本))


cookie获取中 Traceback (most recent call last): File "C:\Users\jayso\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start stdin=PIPE) File "C:\Users\jayso\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 709, in init restore_signals, start_new_session) File "C:\Users\jayso\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 997, in _execute_child startupinfo) FileNotFoundError: [WinError 2] 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run.py", line 20, in run() File "run.py", line 8, in run select_ticket_info.select().main() File "E:\12306-master\init\select_ticket_info.py", line 155, in main getDrvicesID(self) File "E:\12306-master\config\getCookie.py", line 17, in getDrvicesID driver = webdriver.Chrome(executable_path=TickerConfig.CHROME_PATH) File "C:\Users\jayso\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 68, in init self.service.start() File "C:\Users\jayso\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chrome.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Repl Closed

hebejay avatar Sep 22 '19 10:09 hebejay

刷新间隔: 随机(1-3S) 僵尸票关小黑屋时长: 5 下单接口: 2 下单模式: 2 预售踩点时间:13:00:00

cookie获取中 Traceback (most recent call last): File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 76, in start stdin=PIPE) File "/home/ubuntu/anaconda3/lib/python3.7/subprocess.py", line 775, in init restore_signals, start_new_session) File "/home/ubuntu/anaconda3/lib/python3.7/subprocess.py", line 1522, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) PermissionError: [Errno 13] Permission denied: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run.py", line 20, in run() File "run.py", line 8, in run select_ticket_info.select().main() File "/home/ubuntu/super_packet/super_pocket/12306/init/select_ticket_info.py", line 155, in main getDrvicesID(self) File "/home/ubuntu/super_packet/super_pocket/12306/config/getCookie.py", line 17, in getDrvicesID driver = webdriver.Chrome(executable_path=TickerConfig.CHROME_PATH) File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in init self.service.start() File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 88, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: '' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

问题解决了吗?我安装了chromedriver,还是报同样的errno 13

allenmtr avatar Sep 25 '19 03:09 allenmtr

看样子我也是这个问题~~~0~0

wendao-liurenchao avatar Sep 25 '19 09:09 wendao-liurenchao

COOKIE_TYPE =1 改成2 能用了~~~啦啦啦~

wendao-liurenchao avatar Sep 25 '19 09:09 wendao-liurenchao

麻烦您打包发个你改好能用 了的Code我试对比一下吧。谢谢

发自我的 iPhone

在 2019年9月25日,下午5:17,wendao-liurenchao <[email protected]mailto:[email protected]> 写道:

COOKIE_TYPE =1 改成2 能用了~~~啦啦啦~

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/testerSunshine/12306/issues/396?email_source=notifications&email_token=AH2JLI2DFDAE7R7HJ3YZ5V3QLMUCHA5CNFSM4IXZCIT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7RGR7I#issuecomment-534931709, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AH2JLI2JOTJIJ5ZQIWJH5ZLQLMUCHANCNFSM4IXZCITQ.

hebejay avatar Sep 25 '19 11:09 hebejay

下载了安装了chromedriver,也配置了目录如下,还是会报错啊

COOKIE_TYPE = 1

如果COOKIE_TYPE=1,则需配置

路径,下载地址http://chromedriver.storage.googleapis.com/index.html

chromedriver配置版本只要和chrome的大版本匹配就行

CHROME_PATH = "C:/Users/AppData/Local/Google/Chrome/Application"

url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 cookie获取中 Traceback (most recent call last): File "D:\Anaconda\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start stdin=PIPE) File "D:\Anaconda\lib\subprocess.py", line 775, in init restore_signals, start_new_session) File "D:\Anaconda\lib\subprocess.py", line 1178, in _execute_child startupinfo) PermissionError: [WinError 5] 拒绝访问。

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run.py", line 20, in run() File "run.py", line 8, in run select_ticket_info.select().main() File "E:\python\12306\init\select_ticket_info.py", line 156, in main getDrvicesID(self) File "E:\python\12306\config\getCookie.py", line 17, in getDrvicesID driver = webdriver.Chrome(executable_path=TickerConfig.CHROME_PATH) File "D:\Anaconda\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 68, in init self.service.start() File "D:\Anaconda\lib\site-packages\selenium\webdriver\common\service.py", line 88, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'Application' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

372620040 avatar Dec 10 '19 14:12 372620040

服务器那边接口改了,代码没更新

rainFogWindSnow [email protected] 于2019年12月10日周二 下午10:35写道:

下载了安装了chromedriver,也配置了目录如下,还是会报错啊

COOKIE_TYPE = 1 如果COOKIE_TYPE=1,则需配置 路径,下载地址 http://chromedriver.storage.googleapis.com/index.html chromedriver配置版本只要和chrome的大版本匹配就行

CHROME_PATH = "C:/Users/AppData/Local/Google/Chrome/Application"

url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 url: /otn/leftTicket/init返回参数为空, 接口状态码: 302 cookie获取中 Traceback (most recent call last): File "D:\Anaconda\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start stdin=PIPE) File "D:\Anaconda\lib\subprocess.py", line 775, in init restore_signals, start_new_session) File "D:\Anaconda\lib\subprocess.py", line 1178, in _execute_child startupinfo) PermissionError: [WinError 5] 拒绝访问。

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run.py", line 20, in run() File "run.py", line 8, in run select_ticket_info.select().main() File "E:\python\12306\init\select_ticket_info.py", line 156, in main getDrvicesID(self) File "E:\python\12306\config\getCookie.py", line 17, in getDrvicesID driver = webdriver.Chrome(executable_path=TickerConfig.CHROME_PATH) File "D:\Anaconda\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 68, in init self.service.start() File "D:\Anaconda\lib\site-packages\selenium\webdriver\common\service.py", line 88, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'Application' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/testerSunshine/12306/issues/396?email_source=notifications&email_token=AAMJUXLLYIMRQRRK6ZKS2F3QX6SK3A5CNFSM4IXZCIT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGPODYA#issuecomment-564060640, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMJUXORRNMGGM7SHOYVADTQX6SK3ANCNFSM4IXZCITQ .

-- Karl Lok, Thanks and Best regards

whitelok avatar Dec 16 '19 02:12 whitelok

CHROME_PATH中需要填写chromedriver.exe的完整路径,不是chrome.exe的路径,比如: c:/tools/google/chromedriver.exe,我也被原始的TickerConfig.py中的配置给误导了。chromedriver.exe可以从作者给的官方链接中下载。

bbhhhh avatar Dec 25 '19 07:12 bbhhhh

chmod +x webdriver

w550515513 avatar Jan 10 '20 13:01 w550515513