All Projects → WuLC → Amazonrobot

WuLC / Amazonrobot

Licence: mit
Amazon商品引流的 python 爬虫

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Amazonrobot

Pychromeless
Python Lambda Chrome Automation (naming pending)
Stars: ✭ 219 (+125.77%)
Mutual labels:  crawler, selenium
bots-zoo
No description or website provided.
Stars: ✭ 59 (-39.18%)
Mutual labels:  crawler, selenium
Awesome Java Crawler
本仓库收集整理爬虫相关资源,开发语言以Java为主
Stars: ✭ 228 (+135.05%)
Mutual labels:  crawler, selenium
Python3 Spider
Python爬虫实战 - 模拟登陆各大网站 包含但不限于:滑块验证、拼多多、美团、百度、bilibili、大众点评、淘宝,如果喜欢请start ❤️
Stars: ✭ 2,129 (+2094.85%)
Mutual labels:  crawler, selenium
Instagram Profilecrawl
📝 quickly crawl the information (e.g. followers, tags etc...) of an instagram profile.
Stars: ✭ 816 (+741.24%)
Mutual labels:  crawler, selenium
Zhihu fun
基于 Selenium 的知乎关键词爬虫
Stars: ✭ 185 (+90.72%)
Mutual labels:  crawler, selenium
lostark-wait-notifier
🐤️ Lost Ark wait notifier
Stars: ✭ 38 (-60.82%)
Mutual labels:  crawler, selenium
Amazonbigspider
😱Full Automatic Amazon Distributed Spider | 亚马逊分布式四国际站采集选款产品|账号admin,密码adminadmin
Stars: ✭ 140 (+44.33%)
Mutual labels:  amazon, crawler
Price Monitor
京东商品价格监控:监控用户设定商品价格,降价邮件/微信提醒。技术:Python爬虫/IP代理池/JS接口爬取/Selenium页面爬取
Stars: ✭ 634 (+553.61%)
Mutual labels:  crawler, selenium
Netdiscovery
NetDiscovery 是一款基于 Vert.x、RxJava 2 等框架实现的通用爬虫框架/中间件。
Stars: ✭ 573 (+490.72%)
Mutual labels:  crawler, selenium
Instagram Bot
An Instagram bot developed using the Selenium Framework
Stars: ✭ 138 (+42.27%)
Mutual labels:  crawler, selenium
Autocrawler
Google, Naver multiprocess image web crawler (Selenium)
Stars: ✭ 957 (+886.6%)
Mutual labels:  crawler, selenium
Examples Of Web Crawlers
一些非常有趣的python爬虫例子,对新手比较友好,主要爬取淘宝、天猫、微信、豆瓣、QQ等网站。(Some interesting examples of python crawlers that are friendly to beginners. )
Stars: ✭ 10,724 (+10955.67%)
Mutual labels:  crawler, selenium
Tianyancha
pip安装的天眼查爬虫API,指定的单个/多个企业工商信息一键保存为Excel/JSON格式。A Battery-included Scraper API of Tianyancha, the best Chinese business data and investigation platform.
Stars: ✭ 206 (+112.37%)
Mutual labels:  crawler, selenium
Instagram Profilecrawl
💻 Quickly crawl the information (e.g. followers, tags, etc...) of an instagram profile. No login required!
Stars: ✭ 110 (+13.4%)
Mutual labels:  crawler, selenium
Instagramcrawler
A non API python program to crawl public photos, posts or followers
Stars: ✭ 349 (+259.79%)
Mutual labels:  crawler, selenium
Goods Crawling
爬取amazon/bestbuy/costco/6pm 的商品详情
Stars: ✭ 9 (-90.72%)
Mutual labels:  amazon, crawler
Lizard
💐 Full Amazon Automatic Download
Stars: ✭ 41 (-57.73%)
Mutual labels:  amazon, crawler
Adidas Multi Session
(Python) Program to simulate multiple sessions on adidas queue pages.
Stars: ✭ 90 (-7.22%)
Mutual labels:  selenium
Scrapoxy
Scrapoxy hides your scraper behind a cloud. It starts a pool of proxies to send your requests. Now, you can crawl without thinking about blacklisting!
Stars: ✭ 1,322 (+1262.89%)
Mutual labels:  crawler

模拟访问亚马逊商品的爬虫

AmazonRobot 是通过 python 实现的一个通过脚本自动访问Amazon上的商品的爬虫程序。主要实现了用户注册、根据给出的搜索词语和商品的 asin 号进行搜索并访问商品、按照一定概率将商品加入购物车等。同时通过动态修改UA ,维护代理池, 控制爬取速率防止被识别出是爬虫。由于需要解析网页的 JS 代码,整个代码主要依靠 selenium 来解析 JS 代码。

用到的数据库有 RedisMySQLRedis 主要用于存储代理池、用于注册的一些用户信息(姓名,电话,地址,visa卡等);MySQL用于存储被访问的商品的一些信息(asin号,访问日期,日pv量,商品的排名等)。需要先在代码中指定这两个数据库的地址

除了 selenium, 还依赖的第三方库有:redis, MySQLdb, requests, bs4, user_agent;python版本为2.7

整个代码的结构如下:

├── Main.py                         # 主程序入口
├── Robot.py                        # 模拟访问的Robot类
├── get_proxy_and_user_information  # 抓取代理和用户信息,存入Redis
│   ├── ConnectRedis.py             # 需要在该文件中指定 Redis 数据库的地址
│   ├── GetProxy.py
│   ├── GetUserInfo.py
│   ├── IgnoreWarnings.py
│   ├── __init__.py
├── record_product_information      # 更新商品在 MySQL 中的信息
│   ├── create_table.sql
│   ├── GetProductRank.py
│   ├── VisitRecord.py              # 需要在该文件中指定 MySQL 数据库的地址
│   ├── __init__.py
└── scripts                         
    ├── Alarm.py                    # 用于检测主机是否宕机的脚本
    └── ChangeMacAddress.py         # 更改主机 mac 地址      

上面最后的一个文件ChangeMacAddress.py可用于更改主机 mac 地址(目前支持 ubuntu 16.0 和 centos6.0),原来是为了防止被识别出是爬虫而写的,但是后来想想实际上并不能起到这个作用。从计算机网络的知识可知,数据包的mac地址每经过一次转发mac地址都会改变,原因是以太网在链路层中通过arp广播建立arp表用于 IP 和 mac 地址的映射关系,然后进行转发,当数据包从链路层出来后,实际上是根据 mac 地址去查找目的主机去转发的,因此数据包在转发过程中IP地址不变(NAT之类的除外),而mac地址每转发一次就改变一次。显然,我们的网络跟亚马逊的网络不是直连的,因此mac地址肯定会改变多次。

最后,通过 selenium 实现的爬虫实际上是非常消耗内存和CPU的,所以这样访问的效率会非常低下,在实验过程中对于流量较小的商品曾试过一周内将其从第五页推到首页,但是对于流量较大的商品作用就很小了。建议调试的时候带 GUI ,而在服务器运行的时候通过 xvfb 替代GUI,同时结合 Ansible 等实现主机群管理。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].