dgtlmoon / changedetection.io

The best and simplest free open source web page change detection, website watcher, restock monitor and notification service. Restock Monitor, change detection. Designed for simplicity - Simply monitor which websites had a text change for free. Free Open source web page change detection, Website defacement monitoring, Price change notification
https://changedetection.io
Apache License 2.0
15.79k stars 883 forks source link

Implement jqraw #2430

Closed Hritik14 closed 2 weeks ago

Hritik14 commented 2 weeks ago

Builds on top of https://github.com/dgtlmoon/changedetection.io/pull/1744

Fixes: #1472

Hritik14 commented 2 weeks ago

I'm unable to run live server tests (any of them) because of dev server error:

00:11:26 changedetectionio.flask_app: ERROR Exception on /preview/first [GET]
Traceback (most recent call last):
  File "/Users/neo/Projects/offsec/changedetection.io/venv/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/neo/Projects/offsec/changedetection.io/venv/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/neo/Projects/offsec/changedetection.io/venv/lib/python3.10/site-packages/flask_restful/__init__.py", line 298, in error_router
    return original_handler(e)
  File "/Users/neo/Projects/offsec/changedetection.io/venv/lib/python3.10/site-packages/flask_cors/extension.py", line 178, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/Users/neo/Projects/offsec/changedetection.io/venv/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/neo/Projects/offsec/changedetection.io/venv/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/Users/neo/Projects/offsec/changedetection.io/changedetectionio/flask_app.py", line 211, in decorated_view
    return func(*args, **kwargs)
  File "/Users/neo/Projects/offsec/changedetection.io/changedetectionio/flask_app.py", line 1099, in preview_page
    timestamp = versions[-1]
IndexError: list index out of range

Not sure what's wrong here but I've run tests without live server, they're ok and the actual application is also working fine

dgtlmoon commented 2 weeks ago

thanks for the PR! nice to see a test here

File "/Users/neo/Projects/offsec/changedetection.io/changedetectionio/flask_app.py", line 1099, in preview_page timestamp = versions[-1] IndexError: list index out of range

this usually means the test is trying to load the preview page, but there is no succesfully fetched version yet

dgtlmoon commented 2 weeks ago

Thanks again :)

freddieleeman commented 1 week ago

Thanks for completing this! I worked around this by using regex /"(.*)",?/ as output filter.