Skip to content

Commit

Permalink
minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
msmannan00 committed Jan 31, 2025
1 parent 2903243 commit e7d6de1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 6 additions & 3 deletions crawler/request_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def terminate_browser():
if browser:
try:
print("Timeout reached. Closing browser and terminating tasks.")
browser.close()
except Exception:
pass

Expand All @@ -75,8 +74,12 @@ def terminate_browser():

def capture_response(response):
if response.request.resource_type == "document" and response.ok:
raw_parse_mapping[response.url] = response.text()
print("parsed : " + response.url)
try:
cc = response.text()
raw_parse_mapping[response.url] = response.text()
print("parsed : " + response.url)
except Exception as ex:
pass

page.on("response", capture_response)
page.goto(model.seed_url, wait_until="networkidle")
Expand Down
5 changes: 2 additions & 3 deletions shared_collector/main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from crawler.request_manager import check_services_status, parse_leak_data
from shared_collector._example import _example
from shared_collector.scripts._mirror_h import _mirror_h
from shared_collector.scripts._zone_xsec import _zone_xsec

check_services_status()

if __name__ == "__main__":
parse_sample = _mirror_h()
parse_sample = _zone_xsec()
parsed_data, raw_parse_mapping = parse_leak_data({"server": "socks5://127.0.0.1:9150"}, parse_sample)
print(parsed_data)

0 comments on commit e7d6de1

Please sign in to comment.