Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http Error 410 Code #37

Open
wollie83 opened this issue Nov 4, 2020 · 0 comments
Open

Http Error 410 Code #37

wollie83 opened this issue Nov 4, 2020 · 0 comments

Comments

@wollie83
Copy link

wollie83 commented Nov 4, 2020

my code for manage the 410 http error:

get the content

    resp = requests.get(master_json_url)
    if resp.status_code != 200:              
        if resp.status_code == 410:
        	print('HTTP error (410 Gone)')
        	quit(0)
        else:      		
        	match = re.search('<TITLE>(.+)<\/TITLE>', resp.content, re.IGNORECASE)
        	title = match.group(1)
        	print('HTTP error (' + str(resp.status_code) + '): ' + title)
        	quit(0)
@wollie83 wollie83 changed the title Error 401 Http Error 410 Code Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant