-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Crypto engagement top x #645
Labels
Difficulty: Medium 😐
This issue can be solved, but a decent amount of lines need to be changed
New feature ⭐
New feature or request
Priority: Low 🥉
Assign this label if this issue is used once every few days
Comments
StephanAkkerman
added
Priority: Low 🥉
Assign this label if this issue is used once every few days
New feature ⭐
New feature or request
Difficulty: Medium 😐
This issue can be solved, but a decent amount of lines need to be changed
labels
Aug 28, 2024
Would be better if we can construct the query ourselves, so that we do not need to share deviceID etc. |
We can use playwright for this: from playwright.sync_api import sync_playwright
def capture_requests(url, target_url_substring):
with sync_playwright() as p:
# Launch a browser (Chromium in this case)
browser = p.chromium.launch(headless=True)
page = browser.new_page()
# Store requests
captured_requests = []
# Listen for all network requests
page.on(
"request",
lambda request: (
captured_requests.append(request)
if target_url_substring in request.url
else None
),
)
# Visit the website
page.goto(url)
# Wait for the page to load completely
page.wait_for_load_state("networkidle")
# Filter captured requests by the target URL substring
filtered_requests = [
r for r in captured_requests if target_url_substring in r.url
]
# Close the browser
browser.close()
return filtered_requests
# Example usage
url_to_visit = "https://lunarcrush.com/categories/cryptocurrencies"
target_request = "https://lunarcrush.com/api3/auth/request-access?requestAccess=lunar" # Part of the URL to match
requests = capture_requests(url_to_visit, target_request)
for req in requests:
print(f"URL: {req.url}, Method: {req.method}") |
Would add more libraries to the project and a more difficult installation process |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Difficulty: Medium 😐
This issue can be solved, but a decent amount of lines need to be changed
New feature ⭐
New feature or request
Priority: Low 🥉
Assign this label if this issue is used once every few days
https://lunarcrush.com/categories/cryptocurrencies
Sorted on altrank might be more interesting: https://lunarcrush.com/categories/cryptocurrencies?metric=alt_rank&filter=&network=&rpp=20&page=1&cols=&reverse=0
The text was updated successfully, but these errors were encountered: