question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sync querySelectorAll

See original GitHub issue
browser = Chrome(host="127.0.0.1", port=9222, timeout=3, retry=1)
tab = self.br.tabs[0]
tab.set_url('https://bing.com', timeout=5)
import time
time.sleep(3)
sel = tab.querySelectorAll('#sb_form_q')
INFO  2021-10-09 21:27:08 [ichrome] sync_utils.py(247): <Tab(chrome://newtab/)> send: {'method': 'Page.navigate', 'params': {'url': 'https://bing.com'}, 'id': 1}
INFO  2021-10-09 21:27:18 [ichrome] sync_utils.py(489): querySelectorAll crashed for: TypeError('the JSON object must be str, bytes or bytearray, not FailureException'), response: FailureException: TimeoutError()
 
File "/home/j/.local/lib/python3.9/site-packages/ichrome/sync_utils.py", line 492, in querySelectorAll
    raise error
  File "/home/j/.local/lib/python3.9/site-packages/ichrome/sync_utils.py", line 478, in querySelectorAll
    response = json.loads(response)["result"]["result"]["value"]
  File "/usr/lib/python3.9/json/__init__.py", line 339, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not FailureException

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ttygdecommented, Oct 9, 2021

thanks, problem was on my side

0reactions
ClericPycommented, Oct 10, 2021

Alright… I thought they are the same usage of Chrome CDP yet. Sometimes I just want to write a pure Websocket connection manager for CDP…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is JavaScript in the DOM Async or Synchronous Code?
It isn't querySelectorAll is not an asynchronous function. how do you make sure that all of the 'div' elements have been stored to...
Read more >
Using querySelector and querySelectorAll in JavaScript
This tutorial shows how the querySelector and querySelectorAll methods in JavaScript can be used to select DOM elements using CSS-style ...
Read more >
Document.querySelectorAll() - Web APIs | MDN
The Document method querySelectorAll() returns a static (not live) NodeList representing a list of the document's elements that match the ...
Read more >
A Bunch of Options for Looping Over querySelectorAll NodeLists
A common need when writing vanilla JavaScript is to find a selection of elements in the DOM and loop over them.
Read more >
5 Ways To Loop Over DOM Elements With QuerySelectorAll in ...
There are a lot of ways to loop over a NodeList Object (List of DOM elements) that is returned by a querySelectorAll method!...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found