User Tools

Site Tools


crawler:scrapy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

crawler:scrapy [2016/08/17 00:52] – [Scrapy Selectors] admincrawler:scrapy [2022/10/29 16:15] (current) – external edit 127.0.0.1
Line 149: Line 149:
 SET VS90COMNTOOLS=%VS100COMNTOOLS% SET VS90COMNTOOLS=%VS100COMNTOOLS%
 </code> => Fix error: Unable to find vcvarsall.bat </code> => Fix error: Unable to find vcvarsall.bat
 +  * upgrade setuptools:<code bat>
 +pip install -U setuptools
 +</code>
 === Install pyopenssl === === Install pyopenssl ===
 Step by steop install openssl: Step by steop install openssl:
Line 441: Line 444:
   - **Thuật toán đệ quy** để tìm tất cả url liên kết với url khởi tạo và tạo thành mạng lưới url liên kết với nó   - **Thuật toán đệ quy** để tìm tất cả url liên kết với url khởi tạo và tạo thành mạng lưới url liên kết với nó
   - **Thuật toán extract links dựa theo rule** để lọc ra những url mà nó muốn download   - **Thuật toán extract links dựa theo rule** để lọc ra những url mà nó muốn download
-==== linkextractors package ====+==== Scrapy linkextractors package ====
 refer: http://doc.scrapy.org/en/latest/topics/link-extractors.html refer: http://doc.scrapy.org/en/latest/topics/link-extractors.html
  
Line 526: Line 529:
 </code> </code>
 === extract links with linkextractors === === extract links with linkextractors ===
-Extract files in html file:<code python>+Extract files in html file which links in **tags=('script','img')** and **attrs=('src')**:<code python>
 filesExtractor = sle(allow=("/*"), tags=('script','img'), attrs=('src'), deny_extensions = []) filesExtractor = sle(allow=("/*"), tags=('script','img'), attrs=('src'), deny_extensions = [])
 links = [l for l in self.filesExtractor.extract_links(response) if l not in self.seen] links = [l for l in self.filesExtractor.extract_links(response) if l not in self.seen]
crawler/scrapy.1471395175.txt.gz · Last modified: 2022/10/29 16:15 (external edit)