Comments (7)
Could you share with us the exact snippet which is causing that error? And which IDE are you using?
from playwright-python.
PyCharm
when to use as:
from playwright import sync_playwright
sync_plw = sync_playwright()
sync_plw.start()
when later is needed to use sync_plw.stop() ---> stop method is not listed by IDE among available methods.
from playwright-python.
The usage is a bit different, see this example:
from playwright import sync_playwright
playwright = sync_playwright().start()
for browser_type in [playwright.chromium, playwright.firefox, playwright.webkit]:
browser = browser_type.launch()
page = browser.newPage()
page.goto("http://whatsmyuseragent.org/")
page.screenshot(path=f"example-{browser_type.name}.png")
browser.close()
playwright.stop()
from playwright-python.
thanks, I saw it before creation of this improvement ).
from playwright-python.
Then I close it okay?
from playwright-python.
of course, you can. My purpose was if I can control an instance of a context manager with the start method, why I need to use __exit__
or not obviously defined "stop". Everything works with or without this change.
from playwright-python.
So we internally start a driver which is basically the upstream github.com/microsoft/playwright project under the hood. In the upstream package the magic happens and in the Python world we only call the Node.js methods internally with a custom JSON based protocol over stdin/stdout.
Thats why we have to start and stop it. Stop is probably not that important but start is needed to use it.
from playwright-python.
Related Issues (20)
- [Bug]: Website reached from Docker behaves differently HOT 1
- PyInstaller can't package chromium driver on x86_64[Bug]: HOT 4
- [Bug]: Blackscreen browser headless=False CHROME HOT 1
- Python Playwright doesn't work in my computer HOT 2
- Why does executing pytest --tracing on in some code not produce the trace.zip file and also delete the existing test-results directory HOT 6
- [Bug]: `EventContextManager` does not conform to `AbstractContextManager` protocol
- [Feature]: Add extra logging for the PW
- [Bug]: Locator Click() Timeout error in headless session while clickable in non headless HOT 1
- [Ports]: Backport client side changes
- [Docs]: How to run demo code step by step? HOT 1
- playwright1.42,chrome is being controlled by automated testing software HOT 2
- How to Dynamically pass values inside this locator HOT 2
- Unable to pass Dynamic values inside a Locator picked using Playwright Inspector HOT 1
- [Bug]: Zombie thread problem HOT 2
- [Bug]: laywright._impl._errors.Error: Page.goto: Page crashed HOT 4
- How to get the error type Console in the browser? HOT 3
- [Bug]: set_checked() doesn't work on checkbox element of a slider HOT 7
- How to locate the chromewebstore's confirm dialog? HOT 1
- how to get Twitter cookie and login with headless chromium HOT 1
- [Bug]: `Download.failure()` raises `TypeError: expected string or bytes-like object, got 'NoneType'`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playwright-python.