playwright-community / playwright-go

Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
https://playwright-community.github.io/playwright-go/
MIT License
1.94k stars 145 forks source link

example: fix examples/scraping #304

Closed shinshin86 closed 1 year ago

shinshin86 commented 1 year ago

In the process of creating this PR (https://github.com/playwright-community/playwright-go/pull/303), I discovered an error while running the code in examples/scraping.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x158 pc=0x104f3632c]

It seems the titleElement was not being retrieved, so i have fixed the code.