miyakogi / pyppeteer

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

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

Open humblerme opened 5 years ago

humblerme commented 5 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 5 years ago

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