Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python - Scrapy Ebay Test
#1
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
Reply
#2
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?
Reply
#3
scraped_item = {
    'Title' : content.response('td:nth-child(2)').extract(),
    'Price' : content.response('td:nth-child(3)').extract(),
}
Maybe you meant content.css?
Reply
#4
im not getting any content from tr.bot, im getting empty brackets for some reason...
Reply
#5
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']
......
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Scrapy Date Extraction Issue tr8585 1 3,318 Aug-05-2020, 04:32 AM
Last Post: tr8585
  Python Scrapy tr8585 2 2,377 Aug-04-2020, 04:11 AM
Last Post: tr8585
  Scraping data from ebay seller page yuvalta 3 6,001 Sep-25-2019, 04:22 AM
Last Post: sandramoraes
  Python - Scrapy Baggelhsk95 0 2,290 Apr-24-2019, 01:07 PM
Last Post: Baggelhsk95
  Python Scrapy ebay API Baggelhsk95 0 3,206 Nov-21-2018, 11:22 AM
Last Post: Baggelhsk95
  Python scrapy scraped_items Baggelhsk95 2 2,890 Nov-13-2018, 08:30 AM
Last Post: Baggelhsk95
  Python - Scrapy - CSS selector Baggelhsk95 1 5,561 Nov-07-2018, 04:45 PM
Last Post: stranac
  Python - Scrapy - Contains Baggelhsk95 3 4,530 Oct-27-2018, 03:42 PM
Last Post: stranac
  Python - Scrapy Login in Baggelhsk95 3 4,845 Oct-23-2018, 04:24 PM
Last Post: stranac
  Python - Scrapy Login form Baggelhsk95 4 10,818 Oct-16-2018, 08:01 AM
Last Post: Baggelhsk95

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020