Python Forum

Full Version: Python - Scrapy Ebay Test
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i made this quick script just for test, but im not getting any content for some reason.....

here's the code quick code:
# -*- coding: utf-8 -*-
import scrapy


class EbaybotSpider(scrapy.Spider):
    name = 'EbayBot'
    start_urls = ['https://feedback.ebay.de/ws/eBayISAPI.dll?ViewFeedback2&ftab=FeedbackAsSeller&userid=x-parts_de&iid=201792088775&de=off&interval=200&searchInterval=30&which=all&items=200&keyword=201792088775&searchInterval=30']

    def parse(self, response):
        for content in response.css('tr.bot'):
            scraped_item = {
                'Title' : content.response('td:nth-child(2)').extract(),
                'Price' : content.response('td:nth-child(3)').extract(),
            }
            yield scraped_item
What's the response? Is the issue that the tr.bot selector isn't matching anything, or that there isn't a document at all?
scraped_item = {
    'Title' : content.response('td:nth-child(2)').extract(),
    'Price' : content.response('td:nth-child(3)').extract(),
}
Maybe you meant content.css?
im not getting any content from tr.bot, im getting empty brackets for some reason...
Baggelhsk95 Wrote:im not getting any content from tr.bot
If i try in Scrapy shell get content from tr.bot.
>>> response.css("tr.bot")[:2]
[<Selector xpath="descendant-or-self::tr[@class and contains(concat(' ', normalize-space(@class), ' '), ' bot ')]" data='<tr class="bot"><td>\xa0</td><td>Felgen Zen'>,
<Selector xpath="descendant-or-self::tr[@class and contains(concat(' ', normalize-space(@class), ' '), ' bot ')]" data='<tr class="bot"><td>\xa0</td><td>Felgen Zen'>]
Extract something.
>>> for content in response.css('tr.bot'):
...     print(content.select(".//td/text()").extract())
['\xa0', 'Felgen Zentrierring Zentrierringe 70,0 auf 64,2 mm Alufelge (Nr.182431424428)', 'EUR 6,00']
['\xa0', 'Felgen Zentrierring Zentrierringe 67,1 auf 60,1 mm Alufelge (Nr.182431425613)', 'EUR 6,00']
['\xa0', 'Reparatur Satz Armlehne Sitz T4 Pilotensitz VW Bus Sitz Reparieren Caravelle (Nr.401455909545)', 'EUR 6,00']
['\xa0', 'Adapter für Sternschrauben Radschrauben mit Stern SW17 SW19 (Nr.202065796727)', 'EUR 2,80']
......