We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I need to validate https://facebook.com/robots.txt (I have seen the below issue in most of the websites which I cannot disclose)
I'm using reppy==0.4.14
When I try to validate the above with Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
It is giving me a False response.
Small reproducible sample given below
from reppy.robots import Robots useragent = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" # useragent = "Googlebot" robot_url = "https://facebook.com/robots.txt" url = "https://facebook.com/" robots = Robots.fetch(robot_url) res = robots.allowed(url, useragent) print("RESPONSE | ", res)
According to https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) is Googlebot This should give a True response, instead I'm getting False
When I tried user agent as Googlebot in above code, it gave me a True response.
I have also tried downloading robots.txt content and parsing method too. Giving the same issue as above.
Reproducible sample
from reppy.robots import Robots useragent = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" # useragent = "Googlebot" robot_url = "https://facebook.com/robots.txt" url = "https://facebook.com/" import requests payload = {} headers = {} response = requests.request("GET", robot_url, headers=headers, data=payload) robots_content = response.text print("ROBOTS.TXT CONTENT | ", robots_content) robots = Robots.parse(robot_url, robots_content) res = robots.allowed(url, useragent) print("RESPONSE | ", res)
Why giving the full string of user agent instead of token is not working?
Giving Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) is the same as giving Googlebot and should return True response. Ref: https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers
Thank you!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I need to validate https://facebook.com/robots.txt (I have seen the below issue in most of the websites which I cannot disclose)
I'm using reppy==0.4.14
When I try to validate the above with Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
It is giving me a False response.
Small reproducible sample given below
According to https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) is Googlebot
This should give a True response, instead I'm getting False
When I tried user agent as Googlebot in above code, it gave me a True response.
I have also tried downloading robots.txt content and parsing method too.
Giving the same issue as above.
Reproducible sample
Why giving the full string of user agent instead of token is not working?
Giving Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) is the same as giving Googlebot and should return True response.
Ref: https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers
Thank you!
The text was updated successfully, but these errors were encountered: