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 8151213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:18:21+00:00 2026-06-06T15:18:21+00:00

as we see: def parse(self, response): hxs = HtmlXPathSelector(response) sites = hxs.select(‘//ul/li’) items =

  • 0

as we see:

def parse(self, response):
    hxs = HtmlXPathSelector(response)
    sites = hxs.select('//ul/li')
    items = []

    for site in sites:
        item = Website()
        item['name'] = site.select('a/text()').extract()
        item['url'] = site.select('//a[contains(@href, "http")]/@href').extract()
        item['description'] = site.select('text()').extract()
        items.append(item)

    return items

scrapy just get a page response,and find urls in the page response. I think it is just a surface crawl !!

But I want more urls with the definded depth .

what can I do to implement it ??

thank you!!

  • 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-06T15:18:23+00:00Added an answer on June 6, 2026 at 3:18 pm

    I did not understand your question, but I noticed several problems in your code, some of them could be related to your question (see the comments in the code):

    sites = hxs.select('//ul/li')
    items = []
    
    for site in sites:
        item = Website()
        # this extracts a list, so i guess .extract()[0] is expected
        item['name'] = site.select('a/text()').extract() 
        # '//a[...]' maybe you expect that this gets the links within the `site`, but it actually get the links from the entire page; you should use './/a[...]'.
        # And, again, this returns a list, not a single url.
        item['url'] = site.select('//a[contains(@href, "http")]/@href').extract() 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the following Parser definition def rep[T](p: => Parser[T]): Parser[List[T]] I see the argument
parse_emails('long list') def parse_emails(emails) .... stuff return valid_emails, invalid_emails end I see that there
I see at least two different implementations: def add_streams(s1:Stream[Int], s2:Stream[Int]): Stream[Int] = Stream.cons(s1.head +
I have a hello function and it takes n arguments (see below code). def
see this demo from jquery ui you have to hold down the Ctrl key
See here http://www.hanselman.com/blog/InSearchOfThePerfectMonospacedProgrammersFontInconsolata.aspx - for want of a better description - the statement block
See http://support.microsoft.com/kb/312629/EN-US/ I am using reponse.direct in my app as well and I am
See title. Additionally, how can I tell if a given child element is only
See the title of this question. I want to play with the exception raised
See the log statement comments at the end of the code snippet... acceleration.x is

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.