Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Barkin Simsek
CAPTCHA-Monitor
Commits
1ea4b613
Commit
1ea4b613
authored
Jun 08, 2021
by
Barkin Simsek
🐢
Browse files
Let BaseFetcher produce valid HAR exports in JSON format
parent
072ef6a1
Pipeline
#7335
passed with stages
in 2 minutes and 30 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/captchamonitor/fetchers/base_fetcher.py
View file @
1ea4b613
import
os
import
json
import
time
import
shutil
import
logging
...
...
@@ -225,12 +226,13 @@ class BaseFetcher:
self
.
page_source
=
self
.
driver
.
page_source
self
.
page_cookies
=
self
.
driver
.
get_cookies
()
self
.
page_title
=
self
.
driver
.
title
self
.
page_har
=
self
.
driver
.
execute_async_script
(
har_dict
=
self
.
driver
.
execute_async_script
(
"""
var callback = arguments[arguments.length - 1];
HAR.triggerExport().then((harLog) => { callback(harLog) });
"""
)
self
.
page_har
=
json
.
dumps
({
"log"
:
har_dict
})
def
get_selenium_logs
(
self
)
->
dict
:
"""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment