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

how to by pass c.OnError #799

Open
quangnx99 opened this issue Jan 3, 2024 · 1 comment
Open

how to by pass c.OnError #799

quangnx99 opened this issue Jan 3, 2024 · 1 comment

Comments

@quangnx99
Copy link

when I scrapping data, page return http status 404 but result still have html response. I want get response. But in colly, if OnError occurred then onHTML do not occurre. How can I get response when error?

@quangnx99
Copy link
Author

when I scrapping data, page return http status 404 but result still have html response. I want get response. But in colly, if OnError occurred then onHTML do not occurre. How can I get response when error?

I resolved with using property ParseHTTPErrorResponse in OnRequest

	c.OnRequest(func(r *colly.Request) {
		c.ParseHTTPErrorResponse = true
	})

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

No branches or pull requests

1 participant