Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed May 24, 2024
1 parent 4b3fd19 commit ea5cf88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const initQueue = async () => {
requestHandler: async ({ request, page }) => {
await page.waitForNetworkIdle();
const title = await page.title();
// scroll 2-3 screen
// set viewport
console.log(title);
const content = await page.content();
console.log(content);
Expand All @@ -44,9 +46,9 @@ const initQueue = async () => {
return crawler;
};

app.get("/", async (req, res) => {
app.post("/", async (req, res) => {
try {
const { url } = req.query;
const { url } = req.body;
if (!url) {
return res.status(400).json({ error: "URL query parameter is required" });
}
Expand Down

0 comments on commit ea5cf88

Please sign in to comment.