2024-09-29 23:31:30 发布
网友
我试图从这个网站上搜集所有医院的数据。 https://www.german-hospital-directory.com/search/Bundesland/Baden-Wuerttemberg.html。在
在查看请求之后,它发出一个表单请求。而且它不能通过废壳
并给出整个html的响应。如何提取每个医院的数据,如URL、名称、图像和遍历所有医院。任何帮助都将是感激的,因为我是新来刮。在
我需要使用硒还是可以用scrapy来达到这个目的。在
您需要先GET您的URL(以接收cookies):https://www.german-hospital-directory.com/search/Bundesland/Baden-Wuerttemberg.html
GET
但接下来您需要GET这个URL https://www.german-hospital-directory.com/search/_files/main-search/Suchergebnis.jsf
像这样:
start_urls = ['https://www.german-hospital-directory.com/search/Bundesland/Baden-Wuerttemberg.html'] def parse(self, response): yield scrapy.Request( url="https://www.german-hospital-directory.com/search/_files/main-search/Suchergebnis.jsf", callback=self.parse_hospitals ) def parse_hospitals(self, response): #here you have hospitals data .....
您需要先
GET
您的URL(以接收cookies):https://www.german-hospital-directory.com/search/Bundesland/Baden-Wuerttemberg.html但接下来您需要
GET
这个URL https://www.german-hospital-directory.com/search/_files/main-search/Suchergebnis.jsf像这样:
相关问题 更多 >
编程相关推荐