Versão final do tutorial
This commit is contained in:
parent
b0b016a4d9
commit
384488b283
13 changed files with 1046 additions and 310 deletions
17
code/parsing-mix.py
Normal file
17
code/parsing-mix.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import scrapy
|
||||
|
||||
|
||||
class PythonGroupsSpider(scrapy.Spider):
|
||||
name = "pythongroups"
|
||||
|
||||
start_urls = [
|
||||
"http://python.org.br",
|
||||
]
|
||||
|
||||
def parse(self, response):
|
||||
groups = response.css('.card')
|
||||
for group in groups:
|
||||
yield {
|
||||
"name": group.xpath('.//h4/text()').get(),
|
||||
"links": group.xpath('.//a/@href').getall(),
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue