-
Notifications
You must be signed in to change notification settings - Fork 6
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
How to use it? #2
Comments
Sorry, I haven't had a chance to write up a full README yet, I'll do it soon. I've tried to keep the API surface similar to the original JS package for puppeteer-extra. You can use it like: PuppeteerExtra puppeteerExtra = new PuppeteerExtra();
puppeteerExtra.Use(new PuppeteerExtraPluginStealth());
puppeteerExtra.Use(new AnonymizeUaPlugin());
// Add any other plugins you want.
Browser browser = await puppeteerExtra.LaunchAsync(new LaunchOptions
{
ExecutablePath = "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
Args = new string[] { "--lang=en-US,en;q=0.9" },
DefaultViewport = null
});
Page page = await browser.NewPageAsync();
// Use the page same as you would with puppeteer-sharp. |
I get an error on this line, puppeteerExtra.Use(new AnonymizeUaPlugin(new AnonymizeUaPlugin.Options { MakeWindows = false })); on "new AnonymizeUaPlugin". It says does not contain a constructor that takes 1 arguments. |
@Bambalow28 Oops you're right. It looks like I made a small change locally that I forgot to push. I've updated my example to remove the options argument. |
@shravan2x also I had it workinf but when I tested for detection it failed on web driver? |
@Bambalow28 My example above only adds two plugins. Did you remember to add the plugin for webdriver? Check the Evasions folder in this repo for a few more plugins than the two mentioned above. |
ohhh okay. Will try now. |
got it thanks! |
Do u know how to bypass captchas? Or how to be able to show captcha into form in c#? |
@Bambalow28 Bypassing/solving captchas is a subject complex and extensive enough to have a full college course on it. It's pretty far out of scope for this library. For the purpose of automating the web, PuppeteerSharp.Extra can just bridge the feature gap between a headless Chromium instance and a regular desktop one. This is an important step in bypassing/solving captchas, but still only a part of it. Simply displaying a rendered captcha in a C# form is a simpler task. IIRC there's a built-in WinForms component to display web pages (albeit using IE). You can also use an open-source solution like CefSharp that also runs a Chromium instance under the hood. But that project does not use Puppeteer and solves a different problem. |
If you still need to solve captchas automatically, you could consider one of the many commercial products that offload solving them to human workers in India/China/etc. That said, I don't personally support or endorse using any of these products, you should contemplate the ethical considerations for yourself, if any. |
Okay yeah I saw in winforms that I can view web but I was struggle on how to show it in my form. Like just the captcha itself. Also is it possible to login gmail account as soon as chromium instance launches? |
You'll probably have to use javascript to extract the specific information you need from the captcha and display it yourself. That is out-of-scope for this library.
Probably, but that's also out-of-scope and I don't know how to do it. |
Hello, How to use it for puppeteer-sharp?
The text was updated successfully, but these errors were encountered: