1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Scrapy returning that: "ScrapyDeprecationWarning: '2.6' is a deprecated value for the...

Discussão em 'Python' iniciado por Stack, Setembro 13, 2024.

  1. Stack

    Stack Membro Participativo

    Having trouble getting this script to work. It's returning this error:


    ScrapyDeprecationWarning: '2.6' is a deprecated value for the 'REQUEST_FINGERPRINTER_IMPLEMENTATION' setting.

    Here is the script:

    import scrapy

    class HealthcareSpider(scrapy.Spider):
    name = 'healthcare_spider'
    allowed_domains = ['google.com']
    start_urls = ['https://www.google.com/search?q=healthcare+websites+usa']

    def parse(self, response):
    # Extract search results from Google's search page
    results = response.css('div.g')
    for result in results:
    # Extract the URL of each search result
    url = result.css('a::attr(href)').get()
    # Check if the URL is a healthcare website based in the USA
    if 'healthcare' in url and 'usa' in url:
    yield {
    'url': url,
    }
    # Follow the link to the next page of search results, if available
    next_page_url = response.css('a#pnnext::attr(href)').get()
    if next_page_url:
    yield scrapy.Request(response.urljoin(next_page_url), callback=self.parse)



    I tried upgrading scrapy, but that wasn't the issue. A little stuck here. Help would be appreciated.

    Continue reading...

Compartilhe esta Página