0% found this document useful (0 votes)
8 views2 pages

Web Scraping

Uploaded by

jdani84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Web Scraping

Uploaded by

jdani84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Content-Type: text/x-zim-wiki

Wiki-Format: zim 0.6


Creation-Date: 2023-06-25T[Link]+02:00

====== web scraping ======


Created domingo 25 junio 2023

[Link]

[Link]

[Link]

sudo pacman -S scrapy

scrapy startproject tutorial

cd tutorial/spiders
vim quotes_spider.py

''from pathlib import Path''

''import scrapy''

''class QuotesSpider([Link]):''
''name = "quotes"''

''def start_requests(self):''
''urls = [''

''"''[[[Link]
page/1/'']]''",''

''"''[[[Link]
page/2/'']]''",''
'']''
''for url in urls:''
''yield [Link](url=url, callback=[Link])''

''def parse(self, response):''


''page = [Link]("/")[-2]''
''filename = f"quotes-{page}.html"''
''Path(filename).write_bytes([Link])''
''[Link](f"Saved file {filename}")''

--------------------

cd ../..
scrapy crawl <project_name>
scrapy crawl as -o [Link]

scrapy shell '<url>'

==== how to call from gjs ====


[Link]

==== gjs from IDE ====


[Link]
[Link]
[Link]

==== home assistant API ====


[Link]

You might also like