You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so here is the thing i have this script FETCH_JS_SCRIPT = """ var url = arguments[0]; var options = JSON.parse(arguments[1]); var callback = arguments[arguments.length - 1]; async function dispatch() { var data = null; try { const resp = await fetch(url, options); data = { 'headers': Object.fromEntries(resp.headers.entries()), 'ok': resp.ok, 'status': { 'code': resp.status, 'text': resp.statusText, }, 'text': await resp.text(), } callback(data); } catch (error) { callback(data); } }; dispatch(); """
that i can use it with self._driver.execute_async_script(FETCH_JS_SCRIPT, url, json.dumps(opt_string))
to get the chapter text while bypassing cloudflare
url = api_url
opt_string = is dict information for calling
example
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
so here is the thing i have this script
FETCH_JS_SCRIPT = """ var url = arguments[0]; var options = JSON.parse(arguments[1]); var callback = arguments[arguments.length - 1]; async function dispatch() { var data = null; try { const resp = await fetch(url, options); data = { 'headers': Object.fromEntries(resp.headers.entries()), 'ok': resp.ok, 'status': { 'code': resp.status, 'text': resp.statusText, }, 'text': await resp.text(), } callback(data); } catch (error) { callback(data); } }; dispatch(); """
that i can use it with
self._driver.execute_async_script(FETCH_JS_SCRIPT, url, json.dumps(opt_string))
to get the chapter text while bypassing cloudflare
url = api_url
opt_string = is dict information for calling
example
of course this is selenium base (undetected_chromedriver) but its only loading the apiurl like how requests do
Beta Was this translation helpful? Give feedback.
All reactions