Python3 under Scrapy crawler (first volume: Installation issues)

Source: Internet
Author: User

General reptiles are used Urllib package, requests package with regular. BeautifulSoup and other packages mixed use, to achieve the reptile effect, but there is a framework who still use the original Ah, now we talk about Scrapy framework crawler,

Now Python3 compatibility comes up, scrapy not only support Python2 version, have new not old, now say let a lot of people placing installation problem, many people start to install not understand,

The version currently in use is PYTHON3.5 and is installed with PIP3

Installation steps:

1 Installing Wheel

PIP3 Install Wheel

2 Installing Twisted

PIP3 Install TWISTED-17.9.0-CP35-CP35M-WIN_AMD64.WHL

3 Installing lxml

PIP3 Install LXML-4.1.1-CP35-CP35M-WIN_AMD64.WHL

4 Installing Scrapy

PIP3 Install Scrapy

This allows you to successfully install the scrapy, you can create files, but you are not allowed to crawl, once the execution of the crawler file will be error

5 Installing Pywin32

Just the next step.

Then we create the Scrapy folder

Go to the python3.5 file path, if your computer is installed at the same time 2, 3 version must pay attention to the problem. Two version of the environment conflict issues, once the Python3 version of the Scrapy run under the Python2 version incompatibility problem, there will be no moudle error

The path switches to the PYTHON3 running environment:

Scrapy startproject filename

Terminal into the filename directory

Scrapy genspider-t Basic CRAWL1 webname.com

A crawler script file will be created

I'm not going to introduce a few files in the folder.

I say the application of basic reptile setting.py

You can now crawl the page normally.

Python3 under Scrapy crawler (first volume: Installation issues)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.