|
|
|
@ -7,6 +7,8 @@ import requests
|
|
|
|
|
import sys
|
|
|
|
|
import time
|
|
|
|
|
|
|
|
|
|
visualselector_xpath_selectors = 'div,span,form,table,tbody,tr,td,a,p,ul,li,h1,h2,h3,h4, header, footer, section, article, aside, details, main, nav, section, summary'
|
|
|
|
|
|
|
|
|
|
class Non200ErrorCodeReceived(Exception):
|
|
|
|
|
def __init__(self, status_code, url, screenshot=None, xpath_data=None, page_html=None):
|
|
|
|
|
# Set this so we can use it in other parts of the app
|
|
|
|
@ -367,7 +369,7 @@ class base_html_playwright(Fetcher):
|
|
|
|
|
else:
|
|
|
|
|
self.page.evaluate("var include_filters=''")
|
|
|
|
|
|
|
|
|
|
self.xpath_data = self.page.evaluate("async () => {" + self.xpath_element_js.replace('%ELEMENTS%', 'div,span,form,table,tbody,tr,td,a,p,ul,li,h1,h2,h3,h4, header, footer, section, article, aside, details, main, nav, section, summary') + "}")
|
|
|
|
|
self.xpath_data = self.page.evaluate("async () => {" + self.xpath_element_js.replace('%ELEMENTS%', visualselector_xpath_selectors) + "}")
|
|
|
|
|
|
|
|
|
|
# Bug 3 in Playwright screenshot handling
|
|
|
|
|
# Some bug where it gives the wrong screenshot size, but making a request with the clip set first seems to solve it
|
|
|
|
|