scrapy

    0熱度

    1回答

    解析我一直在使用Scrapy並試圖遵循例子只能跟着網址匹配某種正則表達式的那個。 我不是一個Python開發,但我已經嘗試了很多方法,試圖讓這是怎麼回事。 我在Scrapy文檔中使用了示例URL,並且從CrawlSpider延伸並通過LinkExtractor實現了規則。 目前,我想只使用一個自定義的解析器對任何URL的包含在他們所說的「朋友」。 ** Scrapy Python的蜘蛛** imp

    1熱度

    1回答

    我試圖通過URL的從傳遞給scrapy請求回調返回一個列表進行迭代,但我發現了以下錯誤: TypeError: 'Request' object is not iterable 以下作品。我可以看到所有的提取的URL的洪水終端: import scrapy class PLSpider(scrapy.Spider): name = 'pl' start_urls = [

    1熱度

    1回答

    我正在使用Scrapy抓取一個商業目錄,並且遇到了試圖使用變量提取數據的問題。下面是代碼: def parse_page(self, response): url = response.meta.get('URL') # Parse the locations area of the page locations = response.css('address::t

    0熱度

    2回答

    我從一個網站提取的信息與HTML,看起來像類型/信息: <h2> <span class="mw-headline" id="Cast">Cast</span></h2> <ul><li> <a href="/Shota_Sometani" title="Shota Sometani">Shota Sometani</a> - Shinichi Izumi </li><li> <a href=

    -1熱度

    1回答

    我有這個sh文件: #!/bin/bash cd /home/leenga/Desktop/crawlCron scrapy crawl quotes 這裏是我的crontab: */2 * * * * /usr/bin/bash /home/leenga/Desktop/crawlCron/crawlcommand.sh >> /home/leenga/Desktop/crawlCron

    0熱度

    1回答

    我現在正在使用scrapy-redis,並且我可以使用它,並且我成功地通過使用相同的redis服務器在不同的計算機中進行爬網。 但我不明白如何正確使用scrapy-redis管道。 在我的理解中,我認爲我需要另一個腳本而不是蜘蛛來處理redis管道列表中的項目,然後我可以將它們存儲到數據庫中。 我的理解是否正確,我是否必須編寫另一個腳本,這在某種程度上取決於蜘蛛?

    0熱度

    2回答

    class PractiseSpider(scrapy.Spider): name = "practise" allowed_domains = ["practise.com"] start_urls = ['https://practise.com/product/{}/'] def parse(self, response): #do som

    0熱度

    1回答

    everyone。我有issues.Here是我的項目結構: +-- scraper | +-- scraper | +-- classification | | +-- classifier.py | | +-- .gitignore | +-- helpers | | +-- help1.py | +-- spiders | | +-- spider1.py .gitigno

    0熱度

    1回答

    使用Scrapy 1.4.0和修改後的模板,我發現在網上,我發現了以下錯誤: AttributeError: module 'scrapy' has no attribute 'CrawlSpider' 日誌不會出現顯示任何東西的興趣。 代碼: import scrapy from scrapy.spiders import Rule from scrapy.linkextractors im

    1熱度

    1回答

    以下Scrapy crawlspider工作正常,除了URL的輸出(response.url): import scrapy from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor class Spider2(CrawlSpider): #name o