Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
Merge branch 'master' into feature/petr-proxy-country-url
Ondra Urban923dbf76b2fd
diff --cc test/actor.test.jsindex 61af8c3bd,6d6bf16bd..4b63c3eda--- a/test/actor.test.js+++ b/test/actor.test.js@@@ -1063,13 -1059,10 +1065,13 @@@ describe('Apify.getApifyProxyUrl()', (expect(Apify.getApifyProxyUrl({session: 'XYZ',- })).to.be.eql('http://session-XYZ:[email protected]:123');+ })).toBe('http://session-XYZ:[email protected]:123');- expect(Apify.getApifyProxyUrl({ country: 'US' })).to.be.eql('http://country-US:[email protected]:123');++ expect(Apify.getApifyProxyUrl({ country: 'US' })).toBe('http://country-US:[email protected]:123');+- expect(Apify.getApifyProxyUrl()).to.be.eql('http://auto:[email protected]:123');+ expect(Apify.getApifyProxyUrl()).toBe('http://auto:[email protected]:123');+delete process.env[ENV_VARS.PROXY_PASSWORD];delete process.env[ENV_VARS.PROXY_HOSTNAME];delete process.env[ENV_VARS.PROXY_PORT];@@@ -1131,36 -1126,26 +1135,36 @@@process.env[ENV_VARS.PROXY_HOSTNAME] = 'my.host.com';process.env[ENV_VARS.PROXY_PORT] = 123;- expect(() => Apify.getApifyProxyUrl({ session: 'a-b' })).to.throw();- expect(() => Apify.getApifyProxyUrl({ session: 'a$b' })).to.throw();- expect(() => Apify.getApifyProxyUrl({ session: {} })).to.throw();- expect(() => Apify.getApifyProxyUrl({ session: new Date() })).to.throw();- expect(() => Apify.getApifyProxyUrl({ apifyProxySession: new Date() })).to.throw();+ expect(() => Apify.getApifyProxyUrl({ session: 'a-b' })).toThrowError();+ expect(() => Apify.getApifyProxyUrl({ session: 'a$b' })).toThrowError();+ expect(() => Apify.getApifyProxyUrl({ session: {} })).toThrowError();+ expect(() => Apify.getApifyProxyUrl({ session: new Date() })).toThrowError();+ expect(() => Apify.getApifyProxyUrl({ apifyProxySession: new Date() })).toThrowError();- expect(() => Apify.getApifyProxyUrl({ session: 'a_b' })).to.not.throw();- expect(() => Apify.getApifyProxyUrl({ session: '0.34252352' })).to.not.throw();- expect(() => Apify.getApifyProxyUrl({ session: 'aaa~BBB' })).to.not.throw();- expect(() => Apify.getApifyProxyUrl({ session: 'a_1_b' })).to.not.throw();- expect(() => Apify.getApifyProxyUrl({ session: 'a_2' })).to.not.throw();- expect(() => Apify.getApifyProxyUrl({ session: 'a' })).to.not.throw();- expect(() => Apify.getApifyProxyUrl({ session: '1' })).to.not.throw();+ expect(() => Apify.getApifyProxyUrl({ session: 'a_b' })).not.toThrowError();+ expect(() => Apify.getApifyProxyUrl({ session: '0.34252352' })).not.toThrowError();+ expect(() => Apify.getApifyProxyUrl({ session: 'aaa~BBB' })).not.toThrowError();+ expect(() => Apify.getApifyProxyUrl({ session: 'a_1_b' })).not.toThrowError();+ expect(() => Apify.getApifyProxyUrl({ session: 'a_2' })).not.toThrowError();+ expect(() => Apify.getApifyProxyUrl({ session: 'a' })).not.toThrowError();+ expect(() => Apify.getApifyProxyUrl({ session: '1' })).not.toThrowError();- expect(() => Apify.getApifyProxyUrl({ groups: [new Date()] })).to.throw();- expect(() => Apify.getApifyProxyUrl({ groups: [{}, 'fff', 'ccc'] })).to.throw();- expect(() => Apify.getApifyProxyUrl({ groups: ['ffff', 'ff-hf', 'ccc'] })).to.throw();- expect(() => Apify.getApifyProxyUrl({ groups: ['ffff', 'fff', 'cc$c'] })).to.throw();- expect(() => Apify.getApifyProxyUrl({ apifyProxyGroups: [new Date()] })).to.throw();+ expect(() => Apify.getApifyProxyUrl({ groups: [new Date()] })).toThrowError();+ expect(() => Apify.getApifyProxyUrl({ groups: [{}, 'fff', 'ccc'] })).toThrowError();+ expect(() => Apify.getApifyProxyUrl({ groups: ['ffff', 'ff-hf', 'ccc'] })).toThrowError();+ expect(() => Apify.getApifyProxyUrl({ groups: ['ffff', 'fff', 'cc$c'] })).toThrowError();+ expect(() => Apify.getApifyProxyUrl({ apifyProxyGroups: [new Date()] })).toThrowError();++ expect(() => Apify.getApifyProxyUrl({ country: new Date() })).to.throw();+ expect(() => Apify.getApifyProxyUrl({ country: 'aa' })).to.throw();+ expect(() => Apify.getApifyProxyUrl({ country: 'aB' })).to.throw();+ expect(() => Apify.getApifyProxyUrl({ country: 'Ba' })).to.throw();+ expect(() => Apify.getApifyProxyUrl({ country: '11' })).to.throw();+ expect(() => Apify.getApifyProxyUrl({ country: 'DDDD' })).to.throw();+ expect(() => Apify.getApifyProxyUrl({ country: 'dddd' })).to.throw();+ expect(() => Apify.getApifyProxyUrl({ country: 1111 })).to.throw();+delete process.env[ENV_VARS.PROXY_PASSWORD];delete process.env[ENV_VARS.PROXY_HOSTNAME];delete process.env[ENV_VARS.PROXY_PORT];