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

add Chromium support for dynamic page rendering. #17

Open
Cash111 opened this issue Mar 20, 2023 · 0 comments
Open

add Chromium support for dynamic page rendering. #17

Cash111 opened this issue Mar 20, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Cash111
Copy link

Cash111 commented Mar 20, 2023

Description:

  • Add NewHybridRequest for encapsulating a request that uses Chromium.

Example:

func (e *ExampleSpider) StartRequest(req chan<- *tegenaria.Context) {
	for i := 0; i < 20; i++ {
		for _, url := range e.GetFeedUrls() {
			// 生成新的request 对象
			exampleLog.Infof("request %s", url)
			request := tegenaria.NewHybridRequest(url, tegenaria.GET, e.Parser)
			// 生成新的Context
			ctx := tegenaria.NewContext(request, e)
			// 将context发送到req channel
			time.Sleep(time.Second)
			req <- ctx
		}
	}
}
@Cash111 Cash111 added the enhancement New feature or request label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants