Code Monkey home page Code Monkey logo

trainticket_booker's People

Contributors

jakexu avatar shenh10 avatar yeyuguo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

trainticket_booker's Issues

"https://kyfw.12306.cn/otn/leftTicket/init"

class Ticket(object):
    def __init__(self, config_file):
        ## config parser setting
        self.config_file = config_file
        self.settings = configparser.ConfigParser()
        self.settings._interpolation = configparser.ExtendedInterpolation()
        self.settings.read(self.config_file)
        ## environment setting
        self.brower='chrome'
        self.b = Browser(driver_name=self.brower) 
        self.station={}
        self.url = "https://kyfw.12306.cn/otn/leftTicket/init"

这样做合适吗?
self.url = "https://kyfw.12306.cn/otn/leftTicket/init"
经安全检查,该站点存在以下安全风险:
(一)含有木马/病毒或钓鱼
(二)泄露
(三)包含敏感政治话题、色情等内容

这样做合适吗?这样做合适吗?这样做合适吗?!!!

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

如下,在输入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

没有进行刷票

您好,我在使用时可登录,但登录后在cmd输入c,没有进行刷票,希望得到您的帮助,谢谢,以下是部分输出信息。
////////////////////////////以下是输出信息//////////////////////////////
DevTools listening on ws://127.0.0.1:12598/devtools/browser/308198b8-749f-4696-8cd3-f88d71ff8225 exception on 广州!
exception on 南宁东!
宸叉墦寮€闊充箰鎻愰啋
[3768:3472:0112/153605.306:ERROR:service_manager.cc(157)] Connection InterfaceProviderSpec prevented service: content_renderer from binding interface: blink::mojom::ReportingServiceProxy exposed by: content_browser
--Return--

d:\eclipse-workspace\trainticket_booker\crawler.py(139)login()->None
-> pdb.set_trace()
(Pdb)

////////////////配置文件//////////////
new 1.txt

'charmap' codec can't decode byte

hi 你好,
我在运行的时候,报了一个错,如下所示。
好像是编码错误。请问怎么解决呢
谢谢

$ python crawler.py
Traceback (most recent call last):
  File "crawler.py", line 274, in <module>
    ticket_theif = Ticket('./conf/conf.ini')
  File "crawler.py", line 16, in __init__
    self.settings.read(self.config_file)
  File "C:\Python27\lib\site-packages\backports\configparser\__init__.py", line 705, in read
    self._read(fp, filename)
  File "C:\Python27\lib\site-packages\backports\configparser\__init__.py", line 1035, in _read
    for lineno, line in enumerate(fp, start=1):
  File "C:\Python27\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 27: character maps to <undefined>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.