1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "queries": [
13 "valves"
14 ],
15 "urls": [
16 "https://www.thomasnet.com/suppliers/search?searchterm=valves&what=valves&cov=NA",
17 "https://www.thomasnet.com/suppliers/search?searchterm=valves&what=valves&cov=NA&pg=2",
18 "https://www.thomasnet.com/suppliers/search?searchterm=valves&what=valves&cov=NA&pg=2&heading=90370206",
19 "https://www.thomasnet.com/suppliers/usa/valves",
20 "https://www.thomasnet.com/suppliers/search?searchterm=valves&what=valves&cov=NA&where=OH",
21 "https://www.thomasnet.com/suppliers/search?searchterm=valves&what=valves&cov=NA&sort=company_az",
22 "https://www.thomasnet.com/suppliers/search?searchterm=valves&cov=NA&zip=44023&radius=50",
23 "https://www.thomasnet.com/suppliers/search?searchterm=valves&what=valves&cov=NA&ctype=M",
24 "https://www.thomasnet.com/suppliers/usa/ball-valves-90370206",
25 "https://www.thomasnet.com/suppliers/usa/ball-valves-90370206?pg=2",
26 "https://www.thomasnet.com/company/valve-parts-usa-ltd-30875713/profile",
27 "https://www.thomasnet.com/company/modern-fluid-power-inc-564168/brands?heading=90052002",
28 "https://www.thomasnet.com/profile/30875713",
29 "https://www.thomasnet.com/profile/720475",
30 "https://www.thomasnet.com/catalogs/valves-72190305",
31 "https://www.thomasnet.com/company/w-p-law-inc-19686/profile"
32 ],
33 "proxy": {
34 "useApifyProxy": true,
35 "apifyProxyGroups": []
36 },
37 "incrementalMode": false,
38 "emitUnchanged": false,
39 "ignoreFieldsForChanges": []
40};
41
42
43const run = await client.actor("abotapi/thomasnet-supplier-scraper").call(input);
44
45
46console.log('Results from dataset');
47console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
48const { items } = await client.dataset(run.defaultDatasetId).listItems();
49items.forEach((item) => {
50 console.dir(item);
51});
52
53