Skip to content

Commit

Permalink
fix: ScrapingAnt Mobile Keyword Scrape not working
Browse files Browse the repository at this point in the history
  • Loading branch information
towfiqi committed Jan 12, 2023
1 parent a1108d2 commit acc0b39
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scrapers/services/scrapingant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ const scrapingAnt:ScraperSettings = {
id: 'scrapingant',
name: 'ScrapingAnt',
website: 'scrapingant.com',
headers: (keyword) => {
// eslint-disable-next-line max-len
const mobileAgent = 'Mozilla/5.0 (Linux; Android 10; SM-G996U Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36';
return keyword && keyword.device === 'mobile' ? { 'Ant-User-Agent': mobileAgent } : {};
},
scrapeURL: (keyword, settings, countryData) => {
const scraperCountries = ['AE', 'BR', 'CN', 'DE', 'ES', 'FR', 'GB', 'HK', 'PL', 'IN', 'IT', 'IL', 'JP', 'NL', 'RU', 'SA', 'US', 'CZ'];
const country = scraperCountries.includes(keyword.country.toUpperCase()) ? keyword.country : 'US';
Expand Down

0 comments on commit acc0b39

Please sign in to comment.