8000 FcgUpdate README.md by prestige10 · Pull Request #8 · fetchfox/fetchfox-sdk-python · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

FcgUpdate README.md #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

prestige10
Copy link

// Search through UK locations
for (const location of UK_LOCATIONS) {
log(Searching location: ${location});

let page = 1;
let hasMorePages = true;

while (hasMorePages && page <= MAX_PAGES_TO_SCRAPE) {
    const searchUrl = `${BASE_URL}/maleprofile/${location}/?page=${page}`;
    log(`Fetching page ${page}: ${searchUrl}`);
    
    try {
        await delay(DELAY_BETWEEN_REQUESTS);
        const response = await fetch(searchUrl, {
            headers: {
                'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
            }
        });
        
        if (!response.ok) {
            log(`Failed to fetch page ${page} for ${location}`);
            hasMorePages = false;
            continue;
        }
        
        const html = await response.text();
        const profileLinks = extractProfileLinks(html, location);
        
        if (profileLinks.length === 0) {
            hasMorePages = false;
            continue;
        }
        
        // Process each profile
        for (const profileUrl of profileLinks) {
            try {
                await delay(DELAY_BETWEEN_REQUESTS);
                const profileData = await scrapeProfilePage(profileUrl);
                if (profileData) {
                    allResults.push(profileData);
                    log(`Found profile: ${profileData.username}`);
                }
            } catch (error) {
                log(`Error scraping profile ${profileUrl}: ${error.message}`);
            }
        }
        
        page++;
    } catch (error) {
        log(`Error fetching page ${page} for ${location}: ${error.message}`);
        hasMorePages = false;
    }
}

}

// Save results
if (allResults.length > 0) {
const csvContent = convertToCSV(allResults);
downloadCSV(csvContent, 'ennvy_uk_profiles.csv');
log(Successfully saved ${allResults.length} profiles to CSV);
} else {
log('No profiles found');
}

return allResults;

@prestige10 prestige10 closed this Apr 29, 2025
@prestige10
Copy link
Author

// Search through UK locations
for (const location of UK_LOCATIONS) {
log(Searching location: ${location});

let page = 1;
let hasMorePages = true;

while (hasMorePages && page <= MAX_PAGES_TO_SCRAPE) {
    const searchUrl = `${BASE_URL}/maleprofile/${location}/?page=${page}`;
    log(`Fetching page ${page}: ${searchUrl}`);
    
    try {
        await delay(DELAY_BETWEEN_REQUESTS);
        const response = await fetch(searchUrl, {
            headers: {
                'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
            }
        });
        
        if (!response.ok) {
            log(`Failed to fetch page ${page} for ${location}`);
            hasMorePages = false;
            continue;
        }
        
        const html = await response.text();
        const profileLinks = extractProfileLinks(html, location);
        
        if (profileLinks.length === 0) {
            hasMorePages = false;
            continue;
        }
        
        // Process each profile
        for (const profileUrl of profileLinks) {
            try {
                await delay(DELAY_BETWEEN_REQUESTS);
                const profileData = await scrapeProfilePage(profileUrl);
                if (profileData) {
                    allResults.push(profileData);
                    log(`Found profile: ${profileData.username}`);
                }
            } catch (error) {
                log(`Error scraping profile ${profileUrl}: ${error.message}`);
            }
        }
        
        page++;
    } catch (error) {
        log(`Error fetching page ${page} for ${location}: ${error.message}`);
        hasMorePages = false;
    }
}

}

// Save results
if (allResults.length > 0) {
const csvContent = convertToCSV(allResults);
downloadCSV(csvContent, 'ennvy_uk_profiles.csv');
log(Successfully saved ${allResults.length} profiles to CSV);
} else {
log('No profiles found');
}

return allResults;

@prestige10 prestige10 reopened this Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0