This thread is trying to answer question "How can I force a page to open in desktop version only in scrapy-playwright?"
probably this https://playwright.dev/docs/emulation#devices
I tried using the set_viewport_size method of playwright but it doesnt work and opens it in default version only AND the page and the code both abruptly shut down
meta = {
"playwright": True,
"playwright_page_methods": [
PageMethod("set_viewport_size",'{"width": 1920, "height": 1080}'),
PageMethod("wait_for_selector", f"(//div[contains(@class,'grid-container')]/descendant::div[contains(@class,'style__container')])[{self.first_page_med}]"),
],
"playwright_include_page": True
}
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].