Skip to content
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

[1.3.1] - Update project dependencies and localization #32

Merged
merged 4 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cardDefIds creator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,24 @@ const DATA_DOMAIN = process.env.DATA_URL;
const scrapeData = async () => {
puppeteer.use(StealthPlugin());
// launch the puppeteer
console.log('Launching the puppeteer...');
const browser = await puppeteer.launch({
headless: 'new',
executablePath: executablePath(),
});
const page = await browser.newPage();
console.log('Requesting html from DATA_URL in .env file...');
// Request html from DATA_URL in .env file
await page.goto(`${DATA_DOMAIN}cards/`);
console.log('Waiting for the cards to load...');
// Wait for the cards to load (modify the selector as needed)
await page.waitForSelector('a.simple-card');
console.log('Get the HTML content after the cards are loaded...');
// Get the HTML content after the cards are loaded
const html = await page.content();
// Close the browser
await browser.close();
console.log('Generating the content for the .js file...');
// Parse HTML using Cheerio
const $ = cheerio.load(html);

Expand Down
47 changes: 29 additions & 18 deletions cardDefIds creator/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading