我想抓取此链接的电子邮件:
https://threebestrated.ca/children-dentists-in-airdrie-ab
但是输出显示null,因为这些不在视图页源中
代码如下:
import scrapy
class BooksSpider(scrapy.Spider):
name = "3bestrated"
allowed_domains = ['threebestrated.ca']
start_urls = ["https://threebestrated.ca/children-dentists-in-airdrie-ab"]
def parse(self, response):
emails = response.xpath("//a[contains(@href, 'mailto:')]/text()").getall()
yield {
"a": emails,
}
电子邮件地址是以某种方式编码的,以防止原始的刮取。下面是一个这样的编码电子邮件地址:
然后使用this JavaScript脚本对其进行解码
因此,您的选择是:
编辑-为了好玩,我对其进行了反向工程:
输出:
相关问题 更多 >
编程相关推荐