[feature request] element screenshot
Closed this issue · 19 comments
why does the screenshot function not work?
Please don't open any further issues without any information at all.
At least the issue or error, you'd have to provide.
Elsewise, I'll have to block you.
Questions should go to discussions, not issues
how can I get a screenshot of an item?
and would like to know what is the difference between your solution and the same undetected_chromedriver or undetected playwright patch
and would like to know what is the difference between your solution and the same
undetected_chromedriver
detectable & old
undetected playwright patch
buggy & detectable
You are still missing features for non-detection:
WebGL WebGL Vendor
Fake CPU core
Fake memory size
Fix sending keys and mouse move
Are you suggesting we use cdp to get the image?
yes, see https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot
You are still missing features for non-detection:
features except of Fix sending keys and mouse move
are related to fingerprinting, not a leak which makes you detected.
driverless does not cover fingerprinting (yet)
WebGL Vendor Fake
Not feasible (undetectable) at CDP level
requires either manipulation at OS-level or recompilling chromium. And anyways will make the Canvas fingerprint & GPU Vendor not coorelate correctly => detection.
Generally, not possible at software level at all.
CPU core Fake
there's already https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setHardwareConcurrencyOverride
Will not apply to workers, cors iframes & new pages.
requires either manipulation at OS-level or recompilling chromium or Target-interception (=> timing leaks)
memory size
requires either manipulation at OS-level or recompilling chromium
Fix sending keys and
working on
mouse move
working on
If you wish to speed up things, feel free to specify what exactly & support me
yes, see https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot
Why don't you add this to the core functionality?
features except of Fix sending keys and mouse move are related to fingerprinting, not a leak which makes you detected.
driverless does not cover fingerprinting (yet)
Why then if I do everything manually through the same browser I am not detected.
requires either manipulation at OS-level or recompilling chromium
This is implemented without problems in dolphin anty and its like. Also if I'm not mistaken undet
ected chrome driver substituted WebGL etc.
Here is the code to get the image in base64 format
element_data = await captcha_img.box_model
x = element_data["content"][0][0]
y = element_data["content"][0][1]
width = element_data["width"]
height = element_data["height"]
get_image_bas64 = await driver.execute_cdp_cmd("Page.captureScreenshot", {
"clip": {
"x": x,
"y": y,
"width": width,
"height": height,
"scale": 1
}
})
get_image_bas64 = get_image_bas64["data"]
yes, see https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot
Why don't you add this to the core functionality?
Is planned - just haven't found the time yet
features except of Fix sending keys and mouse move are related to fingerprinting, not a leak which makes you detected.
driverless does not cover fingerprinting (yet)Why then if I do everything manually through the same browser I am not detected.
As I mentioned -
except of Fix sending keys and mouse
I'm working on those
requires either manipulation at OS-level or recompilling chromium
This is implemented without problems in dolphin anty and its like.
Yes - but Dolphin anty
either uses a custom compiled chromium or injects javascript - which generally is detectable
I don't say it isn't possible, neither that this won't get implemented into driverless.
Just saying that it isn't just easy plug & go.
Also if I'm not mistaken undetected chrome driver substituted WebGL etc.
Don't think so - but even if - that would for sure use Javascript injection. Again creates leaks & is detectable
Here is the code to get the image in base64 format
element_data = await captcha_img.box_model x = element_data["content"][0][0] y = element_data["content"][0][1] width = element_data["width"] height = element_data["height"] get_image_bas64 = await driver.execute_cdp_cmd("Page.captureScreenshot", { "clip": { "x": x, "y": y, "width": width, "height": height, "scale": 1 } }) get_image_bas64 = get_image_bas64["data"]
I'll test that code - and if it works implement it:)
Thanks.
I also think we should add a function to wait for the page to load if we click a link on an open page
And add in the documentation in what timeout dimension
ms / s
I also think we should add a function to wait for the page to load if we click a link on an open page
There's an example for that in the readme (wait foe cdp event)
Tho indeed, I could add a function for that
And add in the documentation in what timeout dimension ms / s
always in s. I can write that somewhere tho, good idea
As I mentioned -
I still don't understand what the finger print has to do with it.
If I start the browser (browser by Selenium Driverless) and do everything manually, I don't get any detections
If I do the same actions through the code, it doesn't work.
I'm now thinking maybe the site is waiting for Shift (to enter @) / Ctrl + V.
Now I have made tests, if I enter text from the keyboard and emulate clicks, everything works
I'm also interested in a bug that for some reason by default highlights the url string
What features won't work if I connect to an already running browser?
What features won't work if I connect to an already running browser
anything related to setting proxy & patching the webrtc leak