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

  • Home
  • SEARCH
  • 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 7083227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:09:08+00:00 2026-05-28T07:09:08+00:00

I keep getting an error: invaled syntax for 1.add_xpath(‘tagLine’, ‘//p[@class=tagline]/text()’) and I cannot seem

  • 0

I keep getting an error: invaled syntax for

1.add_xpath('tagLine', '//p[@class="tagline"]/text()')

and I cannot seem to figure out why it is giving me that error, since as far as i can tell it is the same syntax as all of the other 1.add_xpath() methods. my other question is how do I request other pages. basically I am going through one big page and having it go through each link on the page, then once it is done with the page I want it to go to the next (button) for the next large page, but I don’t know how to do that.

   def parse(self, response):
    hxs = HtmlXPathSelector(response)
    for url in hxs.select('//a[@class="title"]/@href').extract():
        yield Request(url, callback=self.description_page)
    for url_2 in hxs.select('//a[@class="POINTER"]/@href').extract():
        yield Request(url_2, callback=self.description_page)

def description_page(self, response):
    l = XPathItemLoader(item=TvspiderItem(), response=response)
    l.add_xpath('title', '//div[@class="m show_head"]/h1/text()')
    1.add_xpath('tagLine', '//p[@class="tagline"]/text()')
    1.add_xpath('description', '//div[@class="description"]/span')
    1.add_xpath('rating', '//div[@class="score"]/text()')
    1.add_xpath('imageSrc', '//div[@class="image_bg"]/img/@src')
    return l.load_item()

any help on this would be greatly appreciated. I am still a bit of a noob when it comes to python and scrapy.

  • 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-05-28T07:09:09+00:00Added an answer on May 28, 2026 at 7:09 am
    def description_page(self, response):
        l = XPathItemLoader(item=TvspiderItem(), response=response)
        l.add_xpath('title', '//div[@class="m show_head"]/h1/text()')
        1.add_xpath('tagLine', '//p[@class="tagline"]/text()')
        1.add_xpath('description', '//div[@class="description"]/span')
        1.add_xpath('rating', '//div[@class="score"]/text()')
        1.add_xpath('imageSrc', '//div[@class="image_bg"]/img/@src')
        return l.load_item()
    

    You have digit 1 instead of variable name l.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting this error in my application and can't figure out what it
Hi I keep getting the error: Error (3709) - /mysite/Pages_Secure/mypage.asp ADODB.Recordset. The connection cannot
I keep getting this error: cannot convert parameter 1 from 'char' to 'LPCWSTR' int
With the following code, I keep getting error C2535 when I compile. It's complaining
Keep getting this error after inserting a subdatasheet into a query and trying to
I keep getting this error System.Web.HttpException was unhandled by user code Message=Validation of viewstate
I keep getting this error when I try to commit a group of executed
I keep getting this error when I try to call Find() public void findTxt(string
I keep getting this error all over the place where I only have jquery
I keep getting this error whenever I call gethostbyname() in my C code. ==7983==

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.