Skip to content

Requests recording #2146

Answered by mdmintz
pkico asked this question in Q&A
Discussion options

You must be logged in to vote

Assuming you haven't opened a new tab and switched to it, it should be picking up the requests. UC Mode may open a new tab when you navigate to a new URL in order to wipe clean any trace of selenium in the browser, which may cause the missing data. For those cases, you can use driver.default_get(url), which will not use UC Mode for that URL, and the script will stay in the same tab. You can also do driver.refresh() from UC Mode.

Example:

from pprint import pformat
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__, "--uc", "--uc-cdp", "-s")

class CDPTests(BaseCase):
    def add_cdp_listener(self):
        self.driver.add_cdp_listener("*", lambda data: print(pformat(data))…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants