Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8941673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:21:33+00:00 2026-06-15T11:21:33+00:00

Im trying to extract data from different ‘tables’ inside a ‘Main Table’ on the

  • 0

Im trying to extract data from different ‘tables’ inside a ‘Main Table’ on the same page (Same URL). The items fields have the same XPath / same structure in all sub-tables, so the problem I am facing is just to add ‘Multiple’ XPath for the tables sections on this page.

Here what my code looks like :

from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from tutorial.items import TutorialItem

class MySpider(BaseSpider):
name = "test"
allowed_domains = ["blabla.com"]
start_urls = ["http://www.blablabl..com"] // Start_url Doesnt change = Same Page



def parse(self, response):
    hxs = HtmlXPathSelector(response)
    titles = [hxs.select('//tr[@class="index class_tr group-6487"]')]

    //Here I would like to have Mltiple XPathSelectors ex:

    // titles = [hxs.select('//tr[@class="index class_tr group-6488"]')]
    // titles = [hxs.select('//tr[@class="index class_tr group-6489"]')]

    // Each for a table section within the same 'Main Table'



    items = []
    for title in titles:
        item = TutorialItem()
        item ['name'] = title.select('td[3]/span/a/text()').extract()
        item ['encryption'] = title.select('td[5]/text()').extract()
        item ['compression'] = title.select('td[8]/text()').extract()
        item ['resolution'] = title.select('td[7]/span/text()').extract()
        items.append(item)
    return items

I would appreciate any hint if this is achievable; If I write a different spider for each table section, then I will end up with 10 spiders for the same URL/table and I am not quite sure if data could be retrieved within the same ‘csv’ file in order.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:21:34+00:00Added an answer on June 15, 2026 at 11:21 am

    Try this:

    titles = [hxs.select('//tr[@class="index class_tr group-6487"] | //tr[@class="index class_tr group-6488"] | //tr[@class="index class_tr group-6489"]')]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to put together a command to extract the data from different tables
I have been trying to extract data from a database and fill in a
I'm trying to figure out how to extract some data from a string according
I'm trying to import a csv (that is a data extract from a SQL
Folks, I'm tryning to extract data from web page using C#.. for the moment
I am trying to extract the TR069 XML data from the HTTP packets which
I am trying to extract the mp3 header from a file. This is different
I am trying to extract data from website using perl API. The process is
I'm trying to extract data from a few large textfiles containing entries about people.
I am trying to extract some data from an XML input with 6 lines,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.