Reputation: 21
I am running await browser.pages() in puppeteer (pyppeteer), however every time it is run, my browser pages go to a very small window size. Is there any way to avoid this? I am for example scanning every 1s to evaluate all browser URLs, and obviously the browser is unusable with such a small window size. If I drag and drop the browser across the screen, the full window size returns so it is a bit of an odd issue. I am using pyppeteer.connect.
async def main():
browser = await pyppeteer.connect(browserURL='http://127.0.0.1:9222')
pages = browser.pages()
print(pages)
i = 0
print(len(pages))
while i < len(pages):
print(await pages[i].evaluate("() => window.location.href"))
i = i + 1
Alternatively, are there any other easy ways to get all open browser URLs? Thanks
Upvotes: 1
Views: 527