Skip to content

Commit

Permalink
Try
Browse files Browse the repository at this point in the history
  • Loading branch information
msveshnikov committed Mar 25, 2024
1 parent f33fbc5 commit 603611e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
4 changes: 0 additions & 4 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
FROM node:20.9.0-bullseye

RUN sed -i'.bak' 's/$/ contrib/' /etc/apt/sources.list
RUN apt-get update && apt-get install firefox-esr -y


# Set the working directory in the container
WORKDIR /app

Expand Down
10 changes: 2 additions & 8 deletions server/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ const userAgents = [

export async function fetchSearchResults(query) {
console.log(query);
const browser = await puppeteer.launch({
product: "firefox",
executablePath: "/usr/bin/firefox-esr",
});
const browser = await puppeteer.launch();
const page = await browser.newPage();
// const randomUserAgent = userAgents[Math.floor(Math.random() * userAgents.length)];
// await page.setUserAgent(randomUserAgent);
Expand All @@ -40,10 +37,7 @@ export async function fetchSearchResults(query) {
}

export async function fetchPageContent(url) {
const browser = await puppeteer.launch({
product: "firefox",
executablePath: "/usr/bin/firefox-esr",
});
const browser = await puppeteer.launch();
const page = await browser.newPage();
const randomUserAgent = userAgents[Math.floor(Math.random() * userAgents.length)];
await page.setUserAgent(randomUserAgent);
Expand Down

0 comments on commit 603611e

Please sign in to comment.