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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:43:51+00:00 2026-06-05T23:43:51+00:00

Hi i am working on scrapy Below is my code class examplespider(CrawlSpider): name =

  • 0

Hi i am working on scrapy

Below is my code

class examplespider(CrawlSpider):
    name = "example"
    domain_name = "www.example.com"
    start_urls = ["http://www.example.com/sch/mobile-/67939/i.html?_catref=1"]

def parse(self,response):
    hxs = HtmlXPathSelector(response)
    for i in xrange(1,10):
        yield Request(url="http://www.example.com/sch/mobile-/67939/i.html?_catref=1?_trkparms=65%253A12%257C66%253A1%257C39%253A1%257C72%253A3276&rt=nc&_catref=1&_dmpt=IN_Mobile_Phones&_trksid=p3286.c0.m14.l1513&_pgn=%d"%i,
                                 callback=self.parse_item)
def parse_item(self,response):
    print response,"Here it is................."

Result::

    File "/home/local/username/project/example/example/spiders/example_spider.py", line 117, in parse
    yield Request(url="http://www.example.com/sch/mobile-/67939/i.html?_catref=1?_trkparms=65%253A12%257C66%253A1%257C39%253A1%257C72%253A3276&rt=nc&_catref=1&_dmpt=IN_Mobile_Phones&_trksid=p3286.c0.m14.l1513&_pgn=%d"%i,
                                 callback=self.parse_item)
    exceptions.ValueError: unsupported format character 'A' (0x41) at index 61

Can any one tell me whats wrong is code and why unsupported format character code error is displaying, whether url is not supported here,also when we supply a a single integer without format specifier i can able to get response.
please let me know the above,

Thanks in advance.

  • 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-05T23:43:53+00:00Added an answer on June 5, 2026 at 11:43 pm

    Your URL contains many unescaped % symbols and you’re trying to interpolate a value into the string using the % operator. Python is looking for % characters to substitute your i into the URL. But the first likely one it sees is %A and that’s not a valid format character. The error message even tells you exactly what has happened and where.

    Probably the easiest general solution is to use the .format() method of the string instead of the % operator:

    ("http://www.example.com/sch/mobile-/67939/i.html?_catref=1?"
     "_trkparms=65%253A12%257C66%253A1%257C39%253A1%257C72%253A3276&rt=nc"
     "&_catref=1&_dmpt=IN_Mobile_Phones&_trksid=p3286.c0.m14.l1513&_pgn={0}").format(i)
    

    It uses different formatting placeholders that don’t conflict with your URL’s use of the % character.

    Or, in this case specifically, since you just want to append your variable to the URL, you could use straight-up concatenation:

    ("http://www.example.com/sch/mobile-/67939/i.html?_catref=1?"
     "_trkparms=65%253A12%257C66%253A1%257C39%253A1%257C72%253A3276&rt=nc"
     "&_catref=1&_dmpt=IN_Mobile_Phones&_trksid=p3286.c0.m14.l1513&_pgn=") + str(i)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was trying to scrape imdb by following code. $url = http://www.imdb.com/search/title?languages=en|1&explore=year; $html =
I am working on scrapy, i fetched some items from website and storing them
I am working with the web scraping framework Scrapy and I am wondering how
I'm writing a XML (de)serializer using Text.XML.Light and Scrap your Boilerplate (at http://github.com/finnsson/Text.XML.Generic )
I'm working on Scrapy to crawl pages,however,I can't handle the pages with javascript. People
I have the (working) code counts = Registration.select('regulator_id').group('regulator_id').count @regulators.each {|r| r.registration_count=counts[r.id]} which allows me
I am trying to scrape http://www.nscb.gov.ph/ggi/database.asp , specifically all the tables you get from
Recently started working with the scrapy library. I am trying to scrape from a
im working with a large team, and im making functions that return html code,
I am trying to scrap some content from a website but the code below

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.