shenh10 / trainticket_booker

火车票刷票脚本
55 stars 128 forks source link

(pdb)输入c后出错,missing‘value’ #6

Closed bumblebeehub closed 6 years ago

bumblebeehub commented 6 years ago

如下,在输入c后报错,浏览器停留在登录后的初试页面不动

(Pdb) c Try 1 times date: 2018-02-12, from 北京, to 杭州 Traceback (most recent call last): File "crawler.py", line 273, in executor this_train = self.checkTicket(date, fromStation, toStation) File "crawler.py", line 164, in checkTicket self.b.add_cookie({'name': '_jc_save_fromStation', 'value': self.station[fromStation]}) File "F:\Application\Python\python35\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 872, in add_cookie self.execute(Command.ADD_COOKIE, {'cookie': cookie_dict}) File "F:\Application\Python\python35\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute self.error_handler.check_response(response) File "F:\Application\Python\python35\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 237, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: invalid argument: missing 'value' (Session info: chrome=63.0.3239.132) (Driver info: chromedriver=2.34.522940 (1a76f96f66e3ca7b8e57d503b4dd3bccfba87af1),platform=Windows NT 10.0.16299 x86_64)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "crawler.py", line 323, in ticket_theif.executor() File "crawler.py", line 283, in executor except {IOError, RuntimeError, TypeError, NameError} as e: TypeError: catching classes that do not inherit from BaseException is not allowed

LuckyFroggy commented 6 years ago

我也是这样,请问你解决了吗?

JakeXu commented 6 years ago

如下INI配置文件中的 % 需要改成 %%, 这样就可以正常运行了

[STATIONCOOKIE]
# 将车站名与对应cookie填在下方
广州=%u5E7F%u5DDE%2CGZQ
北京=%u5317%u4EAC%2CBJP