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

AttributeError: 'NoneType' object has no attribute 'geturl' #75

Open
devopsenko opened this issue Jun 10, 2021 · 4 comments
Open

AttributeError: 'NoneType' object has no attribute 'geturl' #75

devopsenko opened this issue Jun 10, 2021 · 4 comments

Comments

@devopsenko
Copy link

I got such error
python3 main.py --domain https://domain.com --output sitemap.xml

Traceback (most recent call last):
File "main.py", line 60, in
crawl.run()
File "/root/python-sitemap/crawler.py", line 127, in run
self.__crawl(current_url)
File "/root/python-sitemap/crawler.py", line 264, in __crawl
final_url = response.geturl()
AttributeError: 'NoneType' object has no attribute 'geturl'

@c4software
Copy link
Owner

Interesting what is your Python version please ?

@devopsenko
Copy link
Author

Python 3.8.2

@ChenKuanSun
Copy link
Contributor

ChenKuanSun commented Aug 25, 2021

It is showing on pdf file url exist.
So content might be not parseable and response will be None.

Need add condition in final_url = response.geturl() like
final_url = response.geturl() if response is not None else current_url

I create a PR #77

@Pacifist2503
Copy link

It is showing on pdf file url exist. So content might be not parseable and response will be None.

Need add condition in final_url = response.geturl() like final_url = response.geturl() if response is not None else current_url

I create a PR #77

Please help me figure out in which file exactly which line to insert, what to exclude the specified error?

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

4 participants