话不多少,今天教大家如何用Python爬虫,自动登录京东网站,查询商品库存,价格,显示购物车详情等。可以指定抢购商品,自动购买下单,然后手动去京东付款就行。
运行环境
Python 2.7
第三方库
- Requests: 简单好用,功能强大的Http请求库
- beautifulsoup4: HTML文档格式化及便签选择器
环境配置
-
pip install requests pip install beautifulsoup4
使用帮助
> python scraper-jd.py -h
usage: scraper-jd.py [-h] [-u USERNAME] [-p PASSWORD] [-g GOOD] [-c COUNT]
[-w WAIT] [-f] [-s]
Simulate to login Jing Dong, and buy sepecified good
optional arguments:
-h, --help show this help messa