File tree Expand file tree Collapse file tree 12 files changed +47
-5
lines changed
js-crawlee-playwright-chrome/src
js-crawlee-puppeteer-chrome/src
python-crawlee-playwright/src
ts-crawlee-playwright-chrome/src
ts-crawlee-puppeteer-chrome/src
ts-playwright-test-runner Expand file tree Collapse file tree 12 files changed +47
-5
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,13 @@ const proxyConfiguration = await Actor.createProxyConfiguration();
24
24
const crawler = new PlaywrightCrawler ( {
25
25
proxyConfiguration,
26
26
requestHandler : router ,
27
+ launchContext : {
28
+ launchOptions : {
29
+ args : [
30
+ '--disable-gpu' , // Mitigates the "crashing GPU process" issue in Docker containers
31
+ ]
32
+ }
33
+ }
27
34
} ) ;
28
35
29
36
await crawler . run ( startUrls ) ;
Original file line number Diff line number Diff line change @@ -20,6 +20,13 @@ const proxyConfiguration = await Actor.createProxyConfiguration();
20
20
const crawler = new PuppeteerCrawler ( {
21
21
proxyConfiguration,
22
22
requestHandler : router ,
23
+ launchContext : {
24
+ launchOptions : {
25
+ args : [
26
+ '--disable-gpu' , // Mitigates the "crashing GPU process" issue in Docker containers
27
+ ]
28
+ }
29
+ }
23
30
} ) ;
24
31
25
32
// Run the crawler with the start URLs and wait for it to finish.
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ async def main() -> None:
32
32
# Limit the crawl to max requests. Remove or increase it for crawling all links.
33
33
max_requests_per_crawl = 50 ,
34
34
headless = True ,
35
+ browser_options = {
36
+ 'args' : ['--disable-gpu' ],
37
+ }
35
38
)
36
39
37
40
# Define a request handler, which will be called for every request.
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ async def main() -> None:
50
50
# Launch Playwright and open a new browser context.
51
51
async with async_playwright () as playwright :
52
52
# Configure the browser to launch in headless mode as per Actor configuration.
53
- browser = await playwright .chromium .launch (headless = Actor .config .headless )
53
+ browser = await playwright .chromium .launch (headless = Actor .config .headless , args = [ '--disable-gpu' ] )
54
54
context = await browser .new_context ()
55
55
56
56
# Process the URLs from the request queue.
Original file line number Diff line number Diff line change @@ -33,6 +33,13 @@ const crawler = new PlaywrightCrawler({
33
33
proxyConfiguration,
34
34
maxRequestsPerCrawl,
35
35
requestHandler : router ,
36
+ launchContext : {
37
+ launchOptions : {
38
+ args : [
39
+ '--disable-gpu' , // Mitigates the "crashing GPU process" issue in Docker containers
40
+ ]
41
+ }
42
+ }
36
43
} ) ;
37
44
38
45
await crawler . run ( startUrls ) ;
Original file line number Diff line number Diff line change @@ -22,6 +22,13 @@ const proxyConfiguration = await Actor.createProxyConfiguration();
22
22
const crawler = new PuppeteerCrawler ( {
23
23
proxyConfiguration,
24
24
requestHandler : router ,
25
+ launchContext : {
26
+ launchOptions : {
27
+ args : [
28
+ '--disable-gpu' , // Mitigates the "crashing GPU process" issue in Docker containers
29
+ ]
30
+ }
31
+ }
25
32
} ) ;
26
33
27
34
// Run the crawler with the start URLs and wait for it to finish.
Original file line number Diff line number Diff line change 1
- FROM apify/actor-node-playwright:20 -1.37 .1
1
+ FROM apify/actor-node-playwright:22 -1.49 .1
2
2
3
3
COPY package*.json ./
4
4
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ storage
10
10
# generated test results
11
11
playwright-report
12
12
test-results.json
13
+ test-results
13
14
14
15
# installed files
15
16
node_modules
Original file line number Diff line number Diff line change 8
8
playwright-report
9
9
src /tests
10
10
test-results.json
11
+ test-results /
Original file line number Diff line number Diff line change 18
18
"dependencies" : {
19
19
"@apify/eslint-config-ts" : " ^0.3.0" ,
20
20
"@apify/tsconfig" : " ^0.1.0" ,
21
- "@playwright/test" : " 1.37 .1" ,
21
+ "@playwright/test" : " 1.49 .1" ,
22
22
"@types/uuid" : " ^9.0.4" ,
23
23
"apify" : " ^3.2.6" ,
24
24
"tsx" : " ^4.6.2" ,
You can’t perform that action at this time.
0 commit comments