美文网首页
爬虫之python scrapy副本篇

爬虫之python scrapy副本篇

作者: Bluemit | 来源:发表于2017-03-15 15:20 被阅读0次

    1. 环境配置

    1. [安利] vim
    sudo apt-get install vim
    

    为什么要用vim呢?因为打开vim你会看到

    Help poor children in Uganda!

    1. scrapy
    sudo apt-get install python-pip
    sudo pip install scrapy
    

    或者

    sudo apt-get install python-scrapy
    
    1. BeautifulSoup
    sudo pip install bs4
    

    2. 背景知识

    审查工具

    F12

    http

    URL/URI
    GET请求:
    POST请求:
    状态码:200 ok, 302重定向,403 forbidden,404 Not Found,500 Internal Service Error
    Cookie
    robots.txt
    timestamp:1970.1.1到现在的秒数

    html

    xml
    class
    div
    p strong
    h1 h2 h3
    不需要成对出现的:img br

    json

    json.cn

    3. scrapy

    迭代器

    4. BeautifulSoup

    soup.find()
    find_all()
    get_text()

    5. 各种可能会遇到的问题

    相关文章

      网友评论

          本文标题:爬虫之python scrapy副本篇

          本文链接:https://www.haomeiwen.com/subject/xzwlnttx.html