【发布时间】:2021-09-15 01:55:10
【问题描述】:
我是 Scrapy 的新手,所以请原谅这个愚蠢的问题。
import scrapy
from bs4 import BeautifulSoup
from scrapy_proj.scrapy_proj.items import PageSourceLoc, ItemField
from scrapy.loader import ItemLoader
from scrapy.http.response import Response
from scrapy import Selector
class MySpider(scrapy.Spider):
name = 'websources'
start_urls = ["https://www.acquistinretepa.it/opencms/opencms/scheda_altri_bandi.html?idBando=b11f430208bfa91e"]
def parse(self, response: Response, **kwargs):
page_info = PageSourceLoc()
soup = BeautifulSoup(response.body, 'html.parser')
print(response.text)
说到查看页面的详细信息,我发现与使用的模板相关的元素,例如:
{{numeroVerdePA}}, {{numeroVerdeIM}}
那些应该已经填充了网页的当前值。我是否缺少一些 Scrapy 设置?
谢谢
【问题讨论】:
标签: python html templates scrapy