Fix scraping - update for modern DownDetector HTML and improve bot detection bypass#16
Merged
Merged
Conversation
…tection bypass Co-authored-by: aaryanrr <73213670+aaryanrr@users.noreply.github.com>
Co-authored-by: aaryanrr <73213670+aaryanrr@users.noreply.github.com>
Co-authored-by: aaryanrr <73213670+aaryanrr@users.noreply.github.com>
…xtract constants Co-authored-by: aaryanrr <73213670+aaryanrr@users.noreply.github.com>
Co-authored-by: aaryanrr <73213670+aaryanrr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix down detector CLI scraping issues
Fix scraping - update for modern DownDetector HTML and improve bot detection bypass
Dec 6, 2025
aaryanrr
reviewed
Dec 7, 2025
| print(status_text) | ||
| else: | ||
| raise Errors.InvalidServiceName( | ||
| "Could not find status information. The service name may be invalid or the page structure has changed." |
Owner
There was a problem hiding this comment.
@copilot how about we improve this error message to better indicate the problem to the user?
Contributor
Author
There was a problem hiding this comment.
Improved the error message in commit e16e998. It now:
- Shows the specific service name that failed
- Provides examples of valid service names (facebook, twitter, instagram)
- Directs users to verify on downdetector.com
Example error message:
Unable to find status for 'invalid-service'. Please verify the service name is correct (e.g., 'facebook', 'twitter', 'instagram'). Visit https://downdetector.com to confirm the service exists.
aaryanrr
requested changes
Dec 7, 2025
Owner
aaryanrr
left a comment
There was a problem hiding this comment.
Fix the comments given in the code. And test the code in an environemnt first.
Co-authored-by: aaryanrr <73213670+aaryanrr@users.noreply.github.com>
aaryanrr
approved these changes
Dec 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DownDetector changed their HTML structure and added bot detection, breaking the single-selector scraper. The CLI now fails silently or returns
AttributeError.Changes
Multi-strategy HTML parsing with backward compatibility:
div#company > div.h2.entry-title(preserves old structure).entry-titlelookup on h1/h2/h3/div (modern pages)Bot detection bypass:
USER_AGENT,DEFAULT_HEADERS)Error handling improvements:
NetworkErrorexception separating network failures from invalid servicesraise_for_status()validationMain.pyfor better UXCode quality:
MIN_STATUS_TEXT_LENGTHconstant.lower()calls to avoid redundant operationsAttributeErrorhandlingExample
The scraper now handles multiple HTML structures:
Error message example:
All strategies tested with mock responses. CodeQL: 0 alerts.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.