ClericPy / ichrome

Chrome controller for Humans, based on Chrome Devtools Protocol(CDP) and python3.7+.
https://pypi.org/project/ichrome/
MIT License
228 stars 29 forks source link

How could I get the value of array? #52

Closed Champollion9012 closed 3 years ago

Champollion9012 commented 3 years ago

I used through ichrome to get a array, want its value. But I always got {'type': 'object', 'subtype': 'array', 'className': 'Array', 'description': 'Array(5)', 'objectId': '6658223733079180638.11.1'} How could I get the value of array inside?

ClericPy commented 3 years ago

await self.get_value(js, jsonify=True, timeout=timeout)

The jsonify arg will trans that array into JSON string.

Or use javascript to JSON.stringify(that_value), Chrome is Javascript friendly and so as ichrome.

Champollion9012 commented 3 years ago

Thx, I must need to use the await at get_value?

ClericPy commented 3 years ago

Thx, I must need to use the await at get_value?

Because it depends on the await tab.send to send websocket message to Chrome debugging port. And the sync version of ichrome ichrome.sync_utils has been deprecated.