-1

I wanted to learn Playwright and I know Python so I wanted to install it on Visual Studio Code. I was following up this youtube tutorial "https://www.youtube.com/watch?v=H2-5ecFwHHQ" and the lecturer saied at 19 sec in this video to put code on Terminal pip3 install playwright and playwright install but playwright install code on terminal didn't work and the lecturer said to put code like this

from playwright.sync api import sync playwright

but visual studio prints out error like this

SyntaxError: invalid syntax
>>> & C:/Users/User/AppData/Local/Programs/Python/Python39/python.exe c:/Users/User/Desktop/first_playwright/first_playwright.py
  File "<stdin>", line 1
    & C:/Users/User/AppData/Local/Programs/Python/Python39/python.exe c:/Users/User/Desktop/first_playwright/first_playwright.py
    ^
SyntaxError: invalid syntax

I installed playwright but don't get why it doesn't work I tired to figure it out how to fix it like 3 hours but can't figure out. Please help me

I put on a cod pip install playwright and expected this code >> from playwright.sync api import sync playwright to work but didn't

rororo
  • 1

1 Answers1

0

You are missing _

from playwright.sync_api import  sync_playwright

And should work

Jaky Ruby
  • 1,409
  • 1
  • 7
  • 12