I'm working on scrapper with chromedp.
To get what i want (page html), i have to click a specific button.
So I used chromedp.click, and chromedp.outerhtml, but i only got html of page before click, not the html of page after click have done.
Can you see my code and advice me how to fix it?
func runCrawler(URL string, lineNum string, stationNm string) {
// settings for crawling
opts := append(chromedp.DefaultExecAllocatorOptions[:],
chromedp.Flag("headless", false))
// create chrome instance
contextVar, cancelFunc := chromedp.NewExecAllocator(context.Background(), opts...)
defer cancelFunc()
contextVar, cancelFunc = chromedp.NewContext(contextVar)
defer cancelFunc()
var htmlContent string
err := chromedp.Run(contextVar,
chromedp.Navigate(URL),
chromedp.WaitVisible(".end_footer_area"),
chromedp.Click(".end_section.station_info_section > div.at_end.sofzqce > div > div.c10jv2ep.wrap_btn_schedule.schedule_time > button"),
chromedp.OuterHTML("html", &htmlContent, chromedp.ByQuery),
)
fmt.Println("html", htmlContent)
checkErr(err)
i also give you homepage and button i need to click
Page URL: https://pts.map.naver.com/end-subway/ends/web/11321/home
Button Area I need to click:
Thank you very much