Python Requests: requests.exceptions.TooManyRedirects: Exceeded 30 redirects

后端 未结 3 1709
孤城傲影
孤城傲影 2020-12-03 14:32

I was trying to crawl this page using python-requests library

import requests
from lxml import etree,html

url = \'http://www.amazon.in/b/ref=sa_menu_mobile_         


        
3条回答
  •  我在风中等你
    2020-12-03 14:46

    Increase of max_redirect is possible by explicitly specifying the count as in example below:

    session = requests.Session()
    session.max_redirects = 60
    session.get('http://www.amazon.com')
    

提交回复
热议问题