Comments (16)
This was closed but it also doesnt work for me
I even tried using that script exactly it screenshotted the page but no directories were created.
Please try this.
const fs = require('fs');
const path = require('path');
function createDirectoryIfNotExists(dirPath) {
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath, { recursive: true });
}
}
async function test() {
const { connect } = await import('puppeteer-real-browser');
createDirectoryIfNotExists(path.join(__dirname, 'zfc'));
connect({
customConfig: {
userDataDir: './zfc',
},
})
.then(async response => {
const { browser, page } = response
await page.goto('https://google.com')
setInterval(() => {
page.screenshot({ path: 'example.png' }).catch(error => { console.log(error.message) })
}, 1000);
})
.catch(error => {
console.log(error.message)
})
}
test()
from puppeteer-real-browser.
The library has been updated. This problem should be solved. Can you try again now?
from puppeteer-real-browser.
It's working now, thanks
The library has been updated. This problem should be solved. Can you try again now?
from puppeteer-real-browser.
Hello, there doesn't seem to be a problem. Could you have entered the wrong directory? Can you try / instead of ?
2024-05-07.13-07-53.mp4
(async () => {
var { connect } = await import('puppeteer-real-browser')
const { page, browser } = await connect({
headless: 'auto',
args: [
`--user-data-dir=${__dirname}/9eea9e17-d2e9-400a-bd0f-249c49a0a7b4-3624`,
],
customConfig: {},
skipTarget: [],
fingerprint: false,
turnstile: true,
connectOption: {},
fpconfig: {},
})
try {
setInterval(() => {
page.screenshot({ path: 'screenshot.png' });
}, 1000);
await page.goto('https://jobnib.com/book/i-am-the-luna-chapter-32');
console.log('OK');
await page.waitForTimeout(30000);
} catch (error) {
console.error('Lỗi:', error);
} finally {
// await browser.close();
// pool.end();
// process.exit(1);
}
})();
from puppeteer-real-browser.
This was closed but it also doesnt work for me
from puppeteer-real-browser.
I even tried using that script exactly it screenshotted the page but no directories were created.
from puppeteer-real-browser.
It changes nothing the path already existed. When used with customconfig the page just opens as about:blank and it won’t go to any pages I tried using your fix for that from another issue (set target) but it did nothing
from puppeteer-real-browser.
This is all that happens with your code it uses the directory but than it wont load any pages at all i copy pasted your code directly and made no change it created the directory opened chrome and than wouldnt go farther
from puppeteer-real-browser.
it also only puts three files in the directory the rest of the userdata like cookies etc isnt there.
from puppeteer-real-browser.
This doesnt work man im not trying to be rude but its an issue and you claim it works fine but me and others all have the same issue
from puppeteer-real-browser.
This doesnt work man im not trying to be rude but its an issue and you claim it works fine but me and others all have the same issue
This is an open source project. As the readme file says, you can't make aggressive and demanding requests like this. I'm running Ubuntu and I had no problems when I tested it. I'll start a windows virtual machine and test it when I can.
https://github.com/zfcsoftware/cf-clearance-scraper/blob/main/module/browser.js
You can try to open a browser and use it as in these codes. Please do not continue spamming.
2024-06-14.02-30-05.mp4
from puppeteer-real-browser.
Look man im not spamming im trying to make you aware that the issue isnt "Solved" its an ongoing issue, im also not demanding anything, my posts were unacknowledged so i was unsure if you were taking the issue as an actual issue or just thinking its user error, i am on windows though and maybe that is why it works for you but not me i will try the code in browser.js and i will also try on linux and let you know if it works fine there vs windows
from puppeteer-real-browser.
Use normal puppeter once to initialize the directory which you want, then switch to puppeter-real-browser. I think there is an issue with initializing the user directory in this real-browser. Also use the customconfig parameter to specify the directory.
from puppeteer-real-browser.
from puppeteer-real-browser.
Use normal puppeter once to initialize the directory which you want, then switch to puppeter-real-browser. I think there is an issue with initializing the user directory in this real-browser. Also use the customconfig parameter to specify the directory.
It doesn't work because I tested if I save the data to localStorage
by running it through puppeteer or just opening it as # chrome.exe --user-data-dir=...
, and then through puppeteer-real-browser
, the data is not contained there, which means that puppeteer-real-browser
uses a different directory
from puppeteer-real-browser.
It worked for me to specify the full path of the pre-created directory
customConfig: {
userDataDir: full_path_created_directory,
}
P.S. The error on Windows is not in the puppeteer-real-browser
module, but in the chrome-launcher
module, the full path is not used there(for --user-data-directory
argument), therefore a temporary directory of user data is created
from puppeteer-real-browser.
Related Issues (20)
- TimeoutError ChromeLauncher.launch HOT 1
- WAF Stopped Working HOT 4
- Turnstile not being clicked HOT 1
- Corrupted viewport and Dev Console. HOT 1
- `goto` always timed out when using `userDataDir` and after the 2nd goto. HOT 9
- Headless question HOT 4
- Potentially being detected HOT 1
- Docker no longer works with the latest update HOT 1
- Loading extension via args: [] does not work HOT 1
- This is not working please try this URL HOT 3
- Using puppeteer-real-browser with puppeteer-extra-plugin-recaptcha HOT 1
- New update doesnt work with turnstile button captcha HOT 2
- How to set up 2 concurrent browsers? HOT 1
- Support Puppeteer argument defaultViewport ? HOT 2
- Property 'executionContextId' of 'undefined' HOT 4
- Need an update of puppeteer-core to version ^23
- Replace `lib/data/puppeteer-core` with `puppeteer-core` dependency HOT 3
- Turnstile completion callback, and waitforselector error in 1.3.0 version HOT 1
- bet365 detect your browser HOT 1
- --no-sandbox is no longer supported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppeteer-real-browser.