- 🔭 I’m currently working on Baidu
- 🌱 I’m currently learning ...
- 📫 How to reach me: [email protected]
- 😄 Pronouns: Use code learn code
- ⚡ Fun fact: ...
hongrunhui / node_12306 Goto Github PK
View Code? Open in Web Editor NEW史上最“脑残”的“抢火车票”程序(node.js版)
史上最“脑残”的“抢火车票”程序(node.js版)
可能是 12306那里有变动或是怎么滴,原来的查询余票一直是获取不到信息,我就把 https 换成了 request ,就可以正常使用了
运行npm install提示下列错误
npm WARN [email protected] No repository field.
大神,你会解析吗,求更新
乘客信息默认选的是哪些?
这个是我的json
{
"time": "2018-02-06",
"from_station":
{
"name": "南京",
"code": "NJH",
"pinyin": "nanjing",
"suoxie": "nj",
"other": "54@njn"
},
"end_station": {
"name": "西安",
"code": "XAY",
"pinyin": "xian",
"suoxie": "xa",
"other": "69@xan"
},
"train_num": [
"Z86",
"Z40"
],
"your_mail": "",
"mail_pass": "",
"receive_mail": ""
}
比如说:玉林(yulin)会被识别为 榆林
json数据中没有雅安的数据
Callback must be a function
at maybeCallback (fs.js:129:9)
at Object.writeFile (fs.js:1159:14)
at prompt.then.answer (/Users/xiaofei19/Desktop/gitRepository/node_12306-master/main.js:204:7)
(node:87907) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:87907) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
为啥我这里一直是“没有查询到余票信息”,车次和信息都是对的啊
什么时候出来有自动提交订单功能,不然没什么用, 期待中。。
如题,希望购买杭州东站的车票,发现只有杭州和杭州南
车票查询没有问题,但是同样是163邮箱,邮件却发不出去报错
最好可以直接订票,在需要抢票的时候票源一般都很紧张,还等邮件通知的话票早没了
在win10下,查询不到结果。
另外想问一下能否抓到12306所有的车次信息呢?我想做一个本地的车次查询工具,希望能获取到所有的车次信息到本地。
C:\Users\a7822\Downloads\node_12306-master>node main.js
? 输入日期-time(如:2017-01-27): 2017-02-11
? 输入始发站拼音-from_station(如:shanghai): guangzhou
? 你选哪一个车站? 广州
? 输入终点站拼音-end_station(如:hefei): pingnanan (没有这个车站哦,请重新输入)
? 输入终点站拼音-end_station(如:hefei): pingnannan
? 你选哪一个车站? 平南南
? 输入车次-train_num(如:K1209,多个车次用|分开): D3786
? 输入邮箱-your_mail(如:[email protected]): [email protected]
? 输入密码或者邮箱授权码-mail_pass: [hidden]
? 是否购买学生票?(y/n): No
? 输入收件人邮箱(如果与上面的邮箱一致请直接回车):
(node:840072) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
leftTicket/query
C:\Users\a7822\Downloads\node_12306-master\main.js:251
for (var cr = 0; cr < ct.length; cr++) {
^
TypeError: Cannot read property 'length' of undefined
at b4 (C:\Users\a7822\Downloads\node_12306-master\main.js:251:28)
at IncomingMessage. (C:\Users\a7822\Downloads\node_12306-master\main.js:330:15)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1056:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
train_num:'K571'//车次 这里少逗号
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>403拒绝访问</TITLE>
<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
</HEAD><BODY>
<BR><h1>拒绝访问</h1>
<P>本缓存服务器管理员:<A HREF="mailto:[email protected]">[email protected]</A>
<P>Via:siwtong34:6 (Cdn Cache Server V2.0)</P>
<BR clear="all">
<HR noshade size="1px">
<ADDRESS>
Generated Wed, 29 Mar 2017 08:00:59 GMT by cache.51cdn.com (Cdn Cache Server V2.0)
</ADDRESS>
</BODY></HTML>```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.