Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Hide popups #644

Open
suntong opened this issue Aug 8, 2021 · 2 comments
Open

[Feature] Hide popups #644

suntong opened this issue Aug 8, 2021 · 2 comments
Labels

Comments

@suntong
Copy link

suntong commented Aug 8, 2021

Is your feature request related to a problem? Please describe.

Some site have a first level of "popups" that we need to deal with before we can access their contents.
Like https://finviz.com/news.ashx, if you visit it using Chrome/Chromium via Chrome Devtools Protocol, and take a screenshot, you will see such "popups".

Describe the solution you'd like

There should be an option to "hide" such "popups". It's doable, and the technology is well known.

This is a screenshot that browshot.com is able to "hide popups", with under Advanced Options, the option to hide popups:
https://browshot.com/share/fBn1IghXgzWao2h7T8jk

Describe alternatives you've considered

There is no alternatives to go around such "popups" unless to "hide" them.

Additional context

Can further clarify what I meant by "It's doable, and the technology is well known".

@suntong
Copy link
Author

suntong commented Aug 8, 2021

Here is the test code:

LET doc = DOCUMENT('https://finviz.com/news.ashx', {
    driver: 'cdp'
})

WAIT_ELEMENT(doc, '#news > div > table > tbody > tr:nth-child(2) > td:nth-child(1) > table > tbody', 5000)

LET tracks = ELEMENTS(doc, '#news > div > table > tbody > tr:nth-child(2) > td:nth-child(1) > table > tbody')

And the error will be:

"error": "run program: cdp.Runtime: Evaluate: rpc error: Cannot find context with specified id (code = -32000): WAIT_ELEMENT(doc,'#news > div > table > tbody > tr:nth-child(2) > td:nth-child(1) > table > tbody',5000) at 7:0"

@ziflex
Copy link
Member

ziflex commented Sep 12, 2021

Yeah, this is one of limitations of CDP driver - there is no API that would allow you to attach to opened pop up window.
I will address this feature in later releases.

Meanwhile, you may try to extend CDP driver on your own and explore options of how it could be implemented.
I guess the problem might be in finding a right window if there are other queries in progress being handled by the same browser instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants