fix headless

This commit is contained in:
Elshimy Ziad Magdy Taha 2025-12-15 12:24:13 +05:00
parent 9f7fa431f7
commit ab9346e96b
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@ import (
func GetHTMLRaw(ctx context.Context, googleLink domain.GoogleLink) (string, string, error) { func GetHTMLRaw(ctx context.Context, googleLink domain.GoogleLink) (string, string, error) {
// Set up chromedp options // Set up chromedp options
opts := append(chromedp.DefaultExecAllocatorOptions[:], opts := append(chromedp.DefaultExecAllocatorOptions[:],
chromedp.Flag("headless", false), chromedp.Flag("headless", true),
chromedp.Flag("disable-blink-features", "AutomationControlled"), chromedp.Flag("disable-blink-features", "AutomationControlled"),
chromedp.Flag("excludeSwitches", "enable-automation"), chromedp.Flag("excludeSwitches", "enable-automation"),
chromedp.UserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"), chromedp.UserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"),

View file

@ -16,7 +16,7 @@ func Work(mainCtx context.Context) func(page int, stream chan<- domain.GoogleLin
query := "site:boards.greenhouse.io (Software OR Backend OR Full-Stack) Engineer" query := "site:boards.greenhouse.io (Software OR Backend OR Full-Stack) Engineer"
opts := append(chromedp.DefaultExecAllocatorOptions[:], opts := append(chromedp.DefaultExecAllocatorOptions[:],
chromedp.Flag("headless", false), chromedp.Flag("headless", true),
chromedp.Flag("disable-blink-features", "AutomationControlled"), chromedp.Flag("disable-blink-features", "AutomationControlled"),
chromedp.Flag("excludeSwitches", "enable-automation"), chromedp.Flag("excludeSwitches", "enable-automation"),
chromedp.Flag("disable-web-security", false), chromedp.Flag("disable-web-security", false),