My goal is to open an browser using pyppeteer and creating a new tab. But Visual Studio stops executing the code after the browser = await launch(headless=False)
line.
But executing the same code in for Example Thonny does work.
Any Help?
Here is the code (its just an example form the internet):
import asyncio
from pyppeteer import launch
from pyquery import PyQuery as pq
async def main():
browser = await launch(headless=False)
page = await browser.newPage()
await page.goto("http://quotes.toscrape.com/js/")
doc = pq(await page.content())
print("Quotes:", doc(".quote").length)
await browser.close()
asyncio.run(main())```
Here's the result your code run in my project, which opened a blank browser window:
Open Command Palette and choose Python: Clear Internal Extension Cache
.
If not help, open a new project, create a new virtual environment and select it as interpreter. See create a virtual environment.