miyakogi / pyppeteer

Headless chrome/chromium automation library (unofficial port of puppeteer)
Other
3.56k stars 372 forks source link

I spent hours on this, I'm obviously nubie but..how to get current url? #271

Open humblerme opened 4 years ago

humblerme commented 4 years ago

'page.url' only returns the last url 'page.goto' navigated to, but this may not be the current url the browser is on ( I may have navigated to another url manually.)

how do I get the actual current url?

I would very much appreciate the very code that I can..you know..copy and paste (nubie here). Thank you and..thanks again.

ghost commented 4 years ago

url = await page.evaluate('window.location.href', force_expr=True);