mborsetti / webchanges

webchanges anonymously checks web content (including images) and commands for changes, delivering instant notifications and AI-powered summaries to your favorite platform.
https://pypi.org/project/webchanges/
Other
37 stars 6 forks source link

[BUG] wait_for_selector causes timeout in webchanges but works in Playwright #53

Closed Markus00000 closed 1 year ago

Markus00000 commented 1 year ago

Describe the bug

I am trying to run identical jobs in webchanges and Playwright with two URLs. One URL works as expected in both. The other URL causes a timeout in webchanges but works in Playwright. This happens with the same Playwright installation and within the same virtual environment.

To Reproduce

webchanges job causing timeout:

name: "Continental"
url: "https://www.continental-reifen.de/fahrrad/reifen"
#url: "https://www.continental-tires.com/bicycle/tires"
use_browser: true
wait_for_selector: ".ci-tire-teaser"

Error message:

waiting for locator(".ci-tire-teaser") to be visible

The .com URL does not cause a timeout in webchanges.

The same job in Playwright:

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page()
    page.goto("https://www.continental-reifen.de/fahrrad/reifen")
    #page.goto("https://www.continental-tires.com/bicycle/tires")
    page.wait_for_selector(".ci-tire-teaser")
    print(page.content())
    browser.close()

No timeout for either URL.

If a job worked correctly, the output contains a list of <h3> elements with product names:

webchanges --test-filter 1 | grep h3
python play.py | grep h3

Expected behavior

No timeout in webchanges and no difference between both URLs.

Version info

webchanges: 3.12 Copyright 2020- Mike Borsetti
CPython: 3.10.9 ('main', 'Dec 19 2022 17:35:49') GCC 12.2.0
System: Linux-6.1.1-arch1-1-x86_64-with-glibc2.36

Playwright is version 1.29.0.

mborsetti commented 1 year ago

Hi @Markus00000,

Thanks for the bug report!

I am seeing some increasing timeout errors as well lately and your report is going to help a lot with debugging. My hypothesis is that something was introduced in a later version of Chrome.

So far, I tried to replicate your error with .de by running it as a single job, but was unable to get a timeout error (i.e. it worked fine). I ran it on the following machines:

CPython: 3.10.7 ('main', 'Nov 24 2022 19:45:47') GCC 12.2.0
System: Linux-5.19.0-1014-aws-x86_64-with-glibc2.36
CPython: 3.10.8 ('tags/v3.10.8:aaaf517', 'Oct 11 2022 16:50:30') MSC v.1933 64 bit (AMD64)
System: Windows-10-10.0.22621-SP0

Playwright is 1.29.0 and Chrome is 108.0.5359.124-1 on Linux and 108.0.5359.125 on Windows.

Does the job run for you when you run it standalone (e.g. using --test)? My hypothesis is that parallelism and/or memory may have something to do with the timeouts, but at this point don't quite know.

Markus00000 commented 1 year ago

Thank you for taking a look!

My Chrome version: Chromium 109.0.5414.46

Does the job run for you when you run it standalone (e.g. using --test)?

All my tests were done using --test-filter. I just tried again and still get timeouts.

I think I have another site with the same issue in case you need more.

mborsetti commented 1 year ago

Hi @Markus00000,

Not only I was unable to replicate this issue on your specific site, but the errors I was seeing on the sites I am monitoring disappeared. I chalk it up to some dependency update that was causing it, which in turn was updated to resolve it.

Did the same happened to you? If not, can you try updating dependencies and Chrome and see if that fixes it for you as well?

Markus00000 commented 1 year ago

Still getting the same timeout in a fully updated environment:

Playwright: 1.29.1
Chromium: 109.0.5414.46
webchanges 3.12
mborsetti commented 1 year ago

Am curious to see if this has resolved itself (or if 3.13, for whatever reason, solves it)

Markus00000 commented 1 year ago

The timeout still occurs.

Playwright: 1.36.0 Chromium: 115.0.5790.75 webchanges 3.13

mborsetti commented 1 year ago

Thanks for sharing.

I was able to replicate the timeout condition in webchanges, and the root issue is that the html returned does not include a .ci-tire-teaser selector.

To replicate, I launched Chrome, opened an Incognito window, opened the developer tools, navigated to "https://www.continental-reifen.de/fahrrad/reifen", waited for the page to load and looked for (using search) for .ci-tire-teaser in the "elements" tab of the developer tools, but came up empty. I also repeated the same search by typing $$(".ci-tire-teaser") in the console, to the same result.

I am not sure why the website returns a different HTML to your local Playwright setup; I can only speculate that you may be using a different browser setup (one with cookies?). If so, you may look into user-data-dir for webchanges.

To aid in your debugging, I am releasing version 3.14, which when run in verbose (-v) mode will capture and save in the temporary folder a screenshot, a full page image, and the HTML contents of the page at the moment of the Playwright error (see logs for filenames). If you're running on a computer with a monitor, you can also use --no-headless for debugging.

Markus00000 commented 1 year ago

The site has changed, but I am not sure when. As far as I remember, I enabled the job a few days ago when you commented. The first run was successful. Subsequent runs failed with timeout errors. Then I replied here.

If I come across another site with this error, I will let you know. Thank you!

mborsetti commented 1 year ago

Thanks! Closing for now.

Markus00000 commented 1 year ago

The following job often times out. Whenever I manually open the webpage afterwards, it loads normally.

name: "Xiaomi firmware"
url: "https://xiaomifirmwareupdater.com/firmware/begonia/"
filter:
  - element-by-id: firmware
  - html2text
use_browser: true
wait_for_selector: "#firmware td:has-text('stable')"

Verbose output

2023-09-05 10:08:16,295 cli[139737174497088] INFO: webchanges: 3.14 Copyright 2020- Mike Borsetti
2023-09-05 10:08:16,295 cli[139737174497088] INFO: CPython: 3.11.5 ('main', 'Aug 28 2023 20:02:58') GCC 13.2.1 20230801
2023-09-05 10:08:16,297 cli[139737174497088] INFO: System: Linux-6.4.12-arch1-1-x86_64-with-glibc2.38
2023-09-05 10:08:16,769 storage[139737174497088] INFO: The configuration file /home/m/.config/webchanges/config.yaml is missing directive(s); the following default values are being used:
database:
  engine: sqlite3
  max_snapshots: 4
display:
  empty-diff: true
  error: true
  new: true
  unchanged: false
footnote: null
report:
  browser:
    enabled: false
    title: '[webchanges] {count} changes: {jobs}'
  discord:
    colored: true
    embed: true
    enabled: false
    max_message_length: null
    subject: '{count} changes: {jobs}'
    webhook_url: ''
  email:
    enabled: false
    from: ''
    html: true
    method: smtp
    sendmail:
      path: sendmail
    smtp:
      auth: true
      host: localhost
      insecure_password: ''
      port: 25
      starttls: true
      user: ''
    subject: '[webchanges] {count} changes: {jobs}'
    to: ''
  html:
    diff: unified
    separate: false
  ifttt:
    enabled: false
    event: ''
    key: ''
  mailgun:
    api_key: ''
    domain: ''
    enabled: false
    from_mail: ''
    from_name: ''
    region: us
    subject: '[webchanges] {count} changes: {jobs}'
    to: ''
  markdown:
    details: true
    footer: true
    minimal: false
    separate: false
  matrix:
    access_token: ''
    enabled: false
    homeserver: ''
    room_id: ''
  prowl:
    api_key: ''
    application: ''
    enabled: false
    priority: 0
    subject: '[webchanges] {count} changes: {jobs}'
  pushbullet:
    api_key: ''
    enabled: false
  pushover:
    app: ''
    device: null
    enabled: false
    priority: normal
    sound: spacealarm
    user: ''
  run_command:
    command: ''
    enabled: false
  stdout:
    color: true
    enabled: true
  telegram:
    bot_token: ''
    chat_id: ''
    enabled: false
    silent: false
  text:
    details: true
    footer: true
    line_length: 75
    minimal: false
    separate: false
  tz: null
  webhook:
    enabled: false
    markdown: false
    max_message_length: null
    webhook_url: ''
  xmpp:
    enabled: false
    insecure_password: ''
    recipient: ''
    sender: ''
See documentation at https://webchanges.readthedocs.io/en/stable/configuration.html
2023-09-05 10:08:16,769 storage[139737174497088] INFO: Loaded configuration from /home/m/.config/webchanges/config.yaml
2023-09-05 10:08:16,770 storage[139737174497088] INFO: Using sqlite3 3.43.0 database at /home/m/.cache/webchanges/cache.db
2023-09-05 10:08:16,808 storage[139737174497088] INFO: Loaded 65 jobs from [PosixPath('/home/m/.config/webchanges/jobs.yaml')]
2023-09-05 10:08:16,836 handler[139737044027072] INFO: Job 64: https://xiaomifirmwareupdater.com/firmware/begonia/ started processing (BrowserJob)
2023-09-05 10:08:17,376 jobs[139737044027072] INFO: Job 64: Playwright 1.36.0 launched /home/m/.cache/ms-playwright/chromium-1071/chrome-linux/chrome browser 115.0.5790.75
2023-09-05 10:08:17,452 jobs[139737044027072] INFO: Job 64: /home/m/.cache/ms-playwright/chromium-1071/chrome-linux/chrome 115.0.5790.75 navigating to https://xiaomifirmwareupdater.com/firmware/begonia/
2023-09-05 10:09:47,869 jobs[139737044027072] INFO: Job 64: Browser returned error Timeout 90000ms exceeded.
=========================== logs ===========================
waiting for locator("#firmware td:has-text('stable')") to be visible
============================================================
(https://xiaomifirmwareupdater.com/firmware/begonia/)
2023-09-05 10:09:48,026 jobs[139737044027072] INFO: Job 64: Screenshot saved at /tmp/webchanges_screenshot_64__up80vq9.png
2023-09-05 10:09:48,297 jobs[139737044027072] INFO: Job 64: Full page image saved at /tmp/webchanges_screenshot-full_64_lldgi90t.png
2023-09-05 10:09:48,319 jobs[139737044027072] INFO: Job 64: Page HTML content saved at /tmp/webchanges_content_64_zekk0p1b.html
2023-09-05 10:09:48,421 handler[139737044027072] INFO: Job 64: Job ended with error; incrementing cumulative error runs to 1
2023-09-05 10:09:48,421 handler[139737044027072] INFO: Job 64: https://xiaomifirmwareupdater.com/firmware/begonia/ ended processing
2023-09-05 10:09:48,421 handler[139737174497088] INFO: Job 64: Got exception while processing job <browser use_browser=True url='https://xiaomifirmwareupdater.com/firmware/begonia/' block_elements=[] wait_for_selector="#firmware td:has-text('stable')" filter=[{'element-by-id': 'firmware'}, 'html2text'] index_number=64 name='[TODO: job fails] Xiaomi Redmi Note 8 Pro (begonia): firmware'
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/webchanges/jobs.py", line 1273, in retrieve
    page.wait_for_selector(self.wait_for_selector)
  File "/usr/lib/python3.11/site-packages/playwright/sync_api/_generated.py", line 8325, in wait_for_selector
    self._sync(
  File "/usr/lib/python3.11/site-packages/playwright/_impl/_sync_base.py", line 109, in _sync
    return task.result()
           ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/playwright/_impl/_page.py", line 352, in wait_for_selector
    return await self._main_frame.wait_for_selector(**locals_to_params(locals()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/playwright/_impl/_frame.py", line 322, in wait_for_selector
    await self._channel.send("waitForSelector", locals_to_params(locals()))
  File "/usr/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 61, in send
    return await self._connection.wrap_api_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 482, in wrap_api_call
    return await cb()
           ^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 97, in inner_send
    result = next(iter(done)).result()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
playwright._impl._api_types.TimeoutError: Timeout 90000ms exceeded.
=========================== logs ===========================
waiting for locator("#firmware td:has-text('stable')") to be visible
============================================================

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/webchanges/handler.py", line 184, in process
    data, self.new_etag = self.job.retrieve(self, headless)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/webchanges/jobs.py", line 1337, in retrieve
    raise BrowserResponseError(e.args, None)
webchanges.jobs.BrowserResponseError: Timeout 90000ms exceeded.
=========================== logs ===========================
waiting for locator("#firmware td:has-text('stable')") to be visible
============================================================
2023-09-05 10:09:48,428 reporters[139737174497088] INFO: Submitting with stdout (<class 'webchanges.reporters.StdoutReporter'>)
===========================================================================
01. ERROR: [TODO: job fails] Xiaomi Redmi Note 8 Pro (begonia): firmware
===========================================================================

---------------------------------------------------------------------------
ERROR: [TODO: job fails] Xiaomi Redmi Note 8 Pro (begonia): firmware (https://xiaomifirmwareupdater.com/firmware/begonia/)
---------------------------------------------------------------------------

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/webchanges/jobs.py", line 1273, in retrieve
    page.wait_for_selector(self.wait_for_selector)
  File "/usr/lib/python3.11/site-packages/playwright/sync_api/_generated.py", line 8325, in wait_for_selector
    self._sync(
  File "/usr/lib/python3.11/site-packages/playwright/_impl/_sync_base.py", line 109, in _sync
    return task.result()
           ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/playwright/_impl/_page.py", line 352, in wait_for_selector
    return await self._main_frame.wait_for_selector(**locals_to_params(locals()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/playwright/_impl/_frame.py", line 322, in wait_for_selector
    await self._channel.send("waitForSelector", locals_to_params(locals()))
  File "/usr/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 61, in send
    return await self._connection.wrap_api_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 482, in wrap_api_call
    return await cb()
           ^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 97, in inner_send
    result = next(iter(done)).result()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
playwright._impl._api_types.TimeoutError: Timeout 90000ms exceeded.
=========================== logs ===========================
waiting for locator("#firmware td:has-text('stable')") to be visible
============================================================

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/webchanges/handler.py", line 184, in process
    data, self.new_etag = self.job.retrieve(self, headless)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/webchanges/jobs.py", line 1337, in retrieve
    raise BrowserResponseError(e.args, None)
webchanges.jobs.BrowserResponseError: Timeout 90000ms exceeded.
=========================== logs ===========================
waiting for locator("#firmware td:has-text('stable')") to be visible
============================================================
---------------------------------------------------------------------------

--
Checked 1 source in 1:32 with webchanges 3.14.
2023-09-05 10:09:48,445 storage[139737174497088] INFO: Closed main sqlite3 database file /home/m/.cache/webchanges/cache.db
2023-09-05 10:09:48,447 command[139737174497088] INFO: Exiting with exit code 0

Screenshots

webchanges_screenshot_64__up80vq9

webchanges_screenshot-full_64_lldgi90t

HTML

<!DOCTYPE html><html><head>
<title>Redmi Note 8 Pro (begonia) Firmware Downloads | Xiaomi Firmware Updater</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="The ultimate script that provides firmware packages for Xiaomi devices.">
<meta property="og:title" content="Xiaomi Firmware Updater">
<meta property="og:description" content="The ultimate script that provides firmware packages for Xiaomi devices.">
<meta property="og:image" content="/images/xfu.png">
<link rel="shortcut icon" href="/images/xfu.png" type="image/x-icon">
<meta name="keywords" content="xiaomi, xiaomi firmware, xiaomi firmware updater, firmware updater, firmware download, firmware, firmware downloader, firmware update, xiaomi firmware download, xiaomi firmware update, Xiaomi update, XDA, Xiaomi XDA, Firmware XDA, yshalsager, xfu, redmi, mi, pocophone, poco">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="“Pragma”" content="”no-cache”">
<meta http-equiv="“Expires”" content="”-1″">
<meta http-equiv="“CACHE-CONTROL”" content="”NO-CACHE”">
<link rel="stylesheet" href="/assets/css/main.css">
<script src="/assets/js/jquery.min.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>
<script src="/assets/js/jquery.dropotron.min.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>
<script src="/assets/js/jquery.scrollex.min.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>
<script src="/assets/js/browser.min.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>
<script src="/assets/js/breakpoints.min.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>
<script src="/assets/js/util.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>
<script src="/assets/js/js-yaml.min.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>

<script src="/assets/js/firmware.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>
<link rel="stylesheet" href="/assets/css/downloads.css">

<link rel="stylesheet" href="/assets/css/bootstrap.min.css">
<script src="/assets/js/popper.min.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>
<script src="/assets/js/bootstrap.min.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>

<script type="1d54c5cd8207dbe884d92898-text/javascript" src="/assets/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" type="text/css" href="/assets/css/dataTables.bootstrap4.min.css">
<script type="1d54c5cd8207dbe884d92898-text/javascript" src="/assets/js/dataTables.bootstrap4.min.js"></script>
<link rel="stylesheet" type="text/css" href="/assets/css/responsive.bootstrap4.min.css">
<script type="1d54c5cd8207dbe884d92898-text/javascript" src="/assets/js/dataTables.responsive.min.js"></script>
<script type="1d54c5cd8207dbe884d92898-text/javascript" src="/assets/js/responsive.bootstrap4.min.js"></script>
<script type="1d54c5cd8207dbe884d92898-text/javascript" src="/assets/js/dataTables.file-size.js"></script>

<link rel="stylesheet" href="/assets/css/select2.min.css">
<script src="/assets/js/select2.min.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>
<script type="1d54c5cd8207dbe884d92898-text/javascript" src="//services.vlitag.com/adv1/?q=ca6ce9b724153d7dd6d540129c228734" defer="" async=""></script><script type="1d54c5cd8207dbe884d92898-text/javascript"> var vitag = vitag || {};</script>
</head>
<body class="is-preload">
<div id="page-wrapper">

<header id="header">
<h1><a href="/" data-ref="XiaomiFirmwareUpdater">Xiaomi Firmware Updater</a><span data-ref="by"> by </span><a href="https://github.com/yshalsager">yshalsager</a></h1>
<nav id="nav">
<ul>
<li><a href="/" data-ref="home">Home</a></li>
<li>
<a href="#" class="icon solid fa-angle-down" data-ref="downloads">Downloads</a>
<ul>
<li><a href="/firmware/" data-ref="firmware">Firmware</a></li>
<li><a href="/vendor/" data-ref="vendor">Vendor</a></li>
<li>
<a href="/miui/" data-ref="miui">MIUI</a>
<ul>
<li><a href="/miui/" data-ref="latestmiuiDownloads">Latest MIUI Downloads</a></li>
<li><a href="/miui14/" data-ref="miui13">MIUI 14 Downloads</a></li>
<li><a href="/miui13/" data-ref="miui13">MIUI 13 Downloads</a></li>
<li><a href="/miui12/" data-ref="miui12">MIUI 12 Beta</a></li>
<li><a href="/miui11/" data-ref="miui11">MIUI 11 Beta</a></li>
</ul>
</li>
</ul>
</li>
<li>
<a href="#" class="icon solid fa-angle-down" data-ref="projects">Projects</a>
<ul>
<li><a href="/projects/xiaomi-flashable-firmware-creator/" data-ref="FlashableFWCreator">Flashable FW Creator</a></li>
<li><a href="/projects/miui-updates-tracker/" data-ref="MIUITracker">MIUI Tracker</a></li>
<li><a href="/projects/miui-downloads-scraper/" data-ref="MIUILinksScraper">MIUI Links Scraper</a></li>
<li><a href="/projects/uranus-chatbot/" data-ref="UranusChatBot">Uranus Chat Bot</a></li>
<li><a href="/projects/miui-arb-checker/" data-ref="ARBChecker">ARB Checker</a></li>
<li><a href="/projects/xiaomi-oss-tracker/" data-ref="OSSTracker">OSS Tracker</a></li>
</ul>
</li>
<li>
<a href="#" class="icon solid fa-angle-down" data-ref="more">More</a>
<ul>
<li><a href="/faq/" data-ref="faq">F.A.Q.</a></li>
<li>
<a href="/supported/" data-ref="supportedDevices">Supported Devices</a>
<ul>
<li><a href="/supported/firmware/" data-ref="FirmwareUpdater">Firmware Updater</a></li>
<li><a href="/supported/vendor/" data-ref="VendorUpdater">Vendor Updater</a></li>
<li><a href="/supported/miui/" data-ref="miuiDownloads">MIUI Downloads</a></li>
</ul>
</li>
<li>
<a href="/blog/" data-ref="Blog">Blog</a>
<ul>
<li><a href="/blog/categories/" data-ref="Categories">Categories</a></li>
<li><a href="/blog/archive/" data-ref="Archive">Archive</a></li>
</ul>
</li>
<li><a href="/about/" data-ref="About">About</a></li>
<li><a href="/team/" data-ref="Team">Our Team</a></li>
<li><a href="/contact-us/" data-ref="Contact">Contact Us</a></li>
<li><a href="/privacy/" data-ref="Privacy">Privacy Policy</a></li>
</ul>
</li>
</ul>
</nav>
</header>

<section id="main">
<header>
<h2>Redmi Note 8 Pro (begonia) Firmware Downloads</h2>
</header>
<div class="dropdown-divider"></div>
<div class="container-fluid">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item"><a href="/firmware/">Firmware</a></li>
<li class="breadcrumb-item active" aria-current="page"><a href="/firmware/begonia/">Redmi Note 8 Pro</a></li>
</ol>
</nav>
<div class="alert alert-primary alert-dismissible fade show" role="alert">
Follow Xiaomi Firmware Updater on <a href="https://t.me/XiaomiFirmwareUpdater" class="alert-link">Telegram</a>
or <a href="https://twitter.com/MiFwUpdater" class="alert-link">Twitter</a> to get notified when a new update is out!
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<h3>Latest Firmware <span class="badge badge-light"><a href="/releases.xml" class="icon solid fa-rss">
<span class="label">RSS</span></a></span></h3>
<div class="card">
<div class="card-body">
<h5 class="card-title">Note</h5>
<h6 class="card-subtitle mb-2 text-muted">You might be looking for something else!</h6>
<p class="card-text">This page shows the latest firmware downloads only.
If you're looking for older releases or other downloads check:</p>
<a href="/archive/firmware/begonia/" class="card-link">Firmware Archive</a>
<a href="/miui/begonia/" class="card-link">MIUI Downloads</a>
<a href="/vendor/begonia/" class="card-link">Vendor Downloads</a>
</div>
</div>
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>

<p><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3257146945160733" data-ad-slot="2588194266" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script type="1d54c5cd8207dbe884d92898-text/javascript">
  (adsbygoogle = window.adsbygoogle || []).push({});
</script></p>
<div class="row justify-content-center">
<div class="col-10">
<div id="vli_ad_320x50_1" class="mx-auto d-xl-none mb-5 d-flex justify-content-center">
<div class="adsbyvli" data-ad-slot="vi_860329703"></div>
<script type="1d54c5cd8207dbe884d92898-text/javascript">(vitag.Init = window.vitag.Init || []).push(function () { viAPItag.display("vi_860329703") })</script>
</div>
<div class="table-responsive-md" style="margin-top: 25px;">
<table id="firmware" class="display dt-responsive nowrap compact table table-striped table-hover table-sm">
<thead class="thead-dark">
<tr>
<th data-ref="branch">Branch</th>
<th data-ref="miui">MIUI</th>
<th data-ref="android">Android</th>
<th data-ref="region">Region</th>
<th data-ref="link">Link</th>
<th data-ref="updated">Updated</th>
</tr>
</thead>
<script type="1d54c5cd8207dbe884d92898-text/javascript">loadFirmwareDownloads('begonia', 'latest')</script>
</table>
</div>
</div>
<div id="vli_ad_160x600_1" class="col-2 d-none d-xl-block">
<div class="adsbyvli" data-ad-slot="vi_860329700"></div>
<script type="1d54c5cd8207dbe884d92898-text/javascript">(vitag.Init = window.vitag.Init || []).push(function () { viAPItag.display("vi_860329700") })</script>
</div>
</div>
</div>
</section>

<footer id="footer">
<ul class="icons">
<li><a href="https://github.com/XiaomiFirmwareUpdater" class="icon brands fa-github" target="_blank"><span class="label">Github</span></a></li>
<li><a href="https://t.me/XiaomiFirmwareUpdater" class="icon brands fa-telegram" target="_blank"><span class="label">Telegram
Channel</span></a>
</li>
<li><a href="https://t.me/MIUIUpdatesTracker" class="icon brands fa-telegram-plane" target="_blank"><span class="label">MIUIUpdatesTracker
</span></a>
</li>
<li><a href="https://twitter.com/MiFwUpdater" class="icon brands fa-twitter" target="_blank"><span class="label">Twitter
</span></a>
</li>
<li style="
          border-left: 1px solid #bfbcbc;
          padding: 0 1.25em 0 1.25em;
          "><a href="https://paypal.me/yshalsager" class="icon brands fa-paypal" target="_blank"><span class="label">PayPal</span></a></li>
<li><a href="https://www.patreon.com/XiaomiFirmwareUpdater" class="icon brands fa-patreon" target="_blank"><span class="label">Patreon</span></a></li>
<li><a href="https://liberapay.com/yshalsager/" class="icon solid fa-donate" target="_blank"><span class="label">LiberaPay</span></a></li>
<li style="
          border-left: 1px solid #bfbcbc;
          padding: 0 1.25em 0 1.25em;
          "><a href="/sitemap/" class="icon solid fa-sitemap"><span class="label">Sitemap</span></a></li>
<li><a href="/rss/" class="icon solid fa-rss"><span class="label">RSS</span></a></li>
</ul>
<ul class="copyright" data-ref="cookies">
<li>This website uses cookies. By using this website, you accept our policies.
Read our <a href="/privacy/">privacy policy</a> for more
information.
</li>
</ul>
<ul class="copyright">
<li data-ref="notice">XiaomiFirmwareUpdater project is not affiliated with Xiaomi Inc. or MIUI ROM Development Team in any way.
</li>
</ul>
<ul class="copyright">
<li data-ref="copyright">© Xiaomi Firmware Updater. All rights reserved.</li>
<li data-ref="template">Template: <a href="https://html5up.net">HTML5 UP</a></li>
<li><span data-ref="siteVersion">Site version</span>: v.1.1.0</li>
</ul>
</footer>
</div>

<script src="/assets/js/main.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>

<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-130929141-1" type="1d54c5cd8207dbe884d92898-text/javascript"></script>
<script type="1d54c5cd8207dbe884d92898-text/javascript">
    window.dataLayer = window.dataLayer || [];
    function gtag() { dataLayer.push(arguments); }
    gtag('js', new Date());

    gtag('config', 'UA-130929141-1');
</script>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" type="1d54c5cd8207dbe884d92898-text/javascript"></script>
<script type="1d54c5cd8207dbe884d92898-text/javascript">(adsbygoogle = window.adsbygoogle || []).pauseAdRequests = 1;</script>
<script async="" src="https://fundingchoicesmessages.google.com/i/pub-3257146945160733?ers=1" nonce="ybjY7I1ryoVktSXqhSucJg" type="1d54c5cd8207dbe884d92898-text/javascript"></script><script nonce="ybjY7I1ryoVktSXqhSucJg" type="1d54c5cd8207dbe884d92898-text/javascript">(function() {function signalGooglefcPresent() {if (!window.frames['googlefcPresent']) {if (document.body) {const iframe = document.createElement('iframe'); iframe.style = 'width: 0; height: 0; border: none; z-index: -1000; left: -1000px; top: -1000px;'; iframe.style.display = 'none'; iframe.name = 'googlefcPresent'; document.body.appendChild(iframe);} else {setTimeout(signalGooglefcPresent, 0);}}}signalGooglefcPresent();})();</script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css">
<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js" data-cfasync="false"></script>
<script type="1d54c5cd8207dbe884d92898-text/javascript">
    window.cookieconsent.initialise({
        "palette": {
            "popup": {
                "background": "#ff5722",
                "text": "#222222"
            },
            "button": {
                "background": "#ffffff",
                "text": "#222222"
            }
        },
        "type": "opt-out",
        "theme": "classic",
        "content": {
            "message": "This website uses cookies to ensure the best experience while using it.  You may see ads that are less relevant to you. These ads use cookies, but not for personalization. Learn more about how we use cookies.",
            "href": "https://xiaomifirmwareupdater.com/privacy/"
        },
        onStatusChange: function (status) {
            if (this.hasConsented()) {
                console.log("hasConsented");
                (adsbygoogle = window.adsbygoogle || []).pauseAdRequests = 0;
                (adsbygoogle = window.adsbygoogle || []).requestNonPersonalizedAds = 0;
            }
            else {
                console.log("didn't Consented");
                (adsbygoogle = window.adsbygoogle || []).pauseAdRequests = 0;
                (adsbygoogle = window.adsbygoogle || []).requestNonPersonalizedAds = 1;
            }
        },
    });
</script>
<script type="1d54c5cd8207dbe884d92898-text/javascript">
    function getCookie(cname) {
        var name = cname + "=";
        var decodedCookie = decodeURIComponent(document.cookie);
        var ca = decodedCookie.split(';');
        for (var i = 0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0) == ' ') {
                c = c.substring(1);
            }
            if (c.indexOf(name) == 0) {
                return c.substring(name.length, c.length);
            }
        }
        return "";
    }
    var cookies_status = getCookie('cookieconsent_status');
    if (cookies_status) {
        if (cookies_status == 'allow' || cookies_status == 'dismiss') {
            (adsbygoogle = window.adsbygoogle || []).requestNonPersonalizedAds = 0;
        }
        else {
            (adsbygoogle = window.adsbygoogle || []).requestNonPersonalizedAds = 1;
        }
        (adsbygoogle = window.adsbygoogle || []).pauseAdRequests = 0;
        (adsbygoogle = window.adsbygoogle || []).push({
            google_ad_client: "ca-pub-3257146945160733",
            enable_page_level_ads: true
        });
    }

</script>
<script type="1d54c5cd8207dbe884d92898-text/javascript" charset="utf-8">
    // Place this code snippet near the footer of your page before the close of the /body tag
    // LEGAL NOTICE: The content of this website and all associated program code are protected under the Digital Millennium Copyright Act. Intentionally circumventing this code may constitute a violation of the DMCA.
    eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) { d[e(c)] = k[c] || e(c) } k = [function (e) { return d[e] }]; e = function () { return '\\w+' }; c = 1 }; while (c--) { if (k[c]) { p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]) } } return p }(';q O=\'\',29=\'1U\';1R(q i=0;i<12;i++)O+=29.X(B.N(B.J()*29.F));q 2u=8,2F=4l,2G=4m,2B=4n,2l=D(e){q o=!1,i=D(){z(k.1i){k.2O(\'2U\',t);E.2O(\'1T\',t)}P{k.2Q(\'2V\',t);E.2Q(\'1Z\',t)}},t=D(){z(!o&&(k.1i||2w.2N===\'1T\'||k.2R===\'2T\')){o=!0;i();e()}};z(k.2R===\'2T\'){e()}P z(k.1i){k.1i(\'2U\',t);E.1i(\'1T\',t)}P{k.2Y(\'2V\',t);E.2Y(\'1Z\',t);q n=!1;2X{n=E.4p==4q&&k.26}34(a){};z(n&&n.2K){(D r(){z(o)H;2X{n.2K(\'16\')}34(t){H 4k(r,50)};o=!0;i();e()})()}}};E[\'\'+O+\'\']=(D(){q e={e$:\'1U+/=\',4r:D(t){q r=\'\',d,n,o,c,s,l,i,a=0;t=e.t$(t);1e(a<t.F){d=t.14(a++);n=t.14(a++);o=t.14(a++);c=d>>2;s=(d&3)<<4|n>>4;l=(n&15)<<2|o>>6;i=o&63;z(32(n)){l=i=64}P z(32(o)){i=64};r=r+U.e$.X(c)+U.e$.X(s)+U.e$.X(l)+U.e$.X(i)};H r},13:D(t){q n=\'\',d,l,c,s,a,i,r,o=0;t=t.1s(/[^A-4t-4u-9\\+\\/\\=]/g,\'\');1e(o<t.F){s=U.e$.1L(t.X(o++));a=U.e$.1L(t.X(o++));i=U.e$.1L(t.X(o++));r=U.e$.1L(t.X(o++));d=s<<2|a>>4;l=(a&15)<<4|i>>2;c=(i&3)<<6|r;n=n+R.T(d);z(i!=64){n=n+R.T(l)};z(r!=64){n=n+R.T(c)}};n=e.n$(n);H n},t$:D(e){e=e.1s(/;/g,\';\');q n=\'\';1R(q o=0;o<e.F;o++){q t=e.14(o);z(t<1t){n+=R.T(t)}P z(t>4v&&t<4w){n+=R.T(t>>6|4x);n+=R.T(t&63|1t)}P{n+=R.T(t>>12|2H);n+=R.T(t>>6&63|1t);n+=R.T(t&63|1t)}};H n},n$:D(e){q o=\'\',t=0,n=4y=1w=0;1e(t<e.F){n=e.14(t);z(n<1t){o+=R.T(n);t++}P z(n>4s&&n<2H){1w=e.14(t+1);o+=R.T((n&31)<<6|1w&63);t+=2}P{1w=e.14(t+1);2o=e.14(t+2);o+=R.T((n&15)<<12|(1w&63)<<6|2o&63);t+=3}};H o}};q r=[\'4i==\',\'4a\',\'4h=\',\'43\',\'44\',\'45=\',\'46=\',\'47=\',\'48\',\'42\',\'49=\',\'4b=\',\'4c\',\'4d\',\'4e=\',\'4f\',\'4g=\',\'4z=\',\'4j=\',\'4A=\',\'4T=\',\'4V=\',\'4W==\',\'4X==\',\'4Y==\',\'4Z==\',\'51=\',\'4U\',\'52\',\'54\',\'55\',\'56\',\'57\',\'58==\',\'59=\',\'53=\',\'4S=\',\'4K==\',\'4R=\',\'4D\',\'4E=\',\'40=\',\'4F==\',\'4G=\',\'4H==\',\'4I==\',\'4C=\',\'4J=\',\'4L\',\'4M==\',\'4N==\',\'4O\',\'4P==\',\'4Q=\'],b=B.N(B.J()*r.F),w=e.13(r[b]),Y=w,L=1,v=\'#2j\',a=\'#4B\',W=\'#2j\',g=\'#41\',Q=\'\',f=\'3N 2E 3e 3l 3q!\',p=\'3m 3i 3g 3p\\\'3o 3b 3n 2z 2v. 3j\\\'s 3k.  3h 3f\\\'t?\',y=\'3d 3r 3c-3t, 3K 3Y\\\'t 3X 3W 2D U 3V 3U.\',s=\'I 3T, I 3S 3R 3Q 2z 2v.  3P 3O 3Z!\',o=0,u=0,n=\'3M.3L\',l=0,Z=t()+\'.2n\';D h(e){z(e)e=e.1Q(e.F-15);q o=k.38(\'3J\');1R(q n=o.F;n--;){q t=R(o[n].1P);z(t)t=t.1Q(t.F-15);z(t===e)H!0};H!1};D m(e){z(e)e=e.1Q(e.F-15);q t=k.3u;x=0;1e(x<t.F){1l=t[x].1I;z(1l)1l=1l.1Q(1l.F-15);z(1l===e)H!0;x++};H!1};D t(e){q n=\'\',o=\'1U\';e=e||30;1R(q t=0;t<e;t++)n+=o.X(B.N(B.J()*o.F));H n};D i(o){q i=[\'3H\',\'3G==\',\'3F\',\'3E\',\'2t\',\'3D==\',\'3C=\',\'3B==\',\'3A=\',\'3z==\',\'3y==\',\'3x==\',\'3w\',\'3v\',\'5a\',\'2t\'],a=[\'2W=\',\'5c==\',\'5l==\',\'6A==\',\'6B=\',\'6F\',\'6G=\',\'6H=\',\'2W=\',\'6y\',\'6K==\',\'6L\',\'6m==\',\'6o==\',\'6u==\',\'5b=\'];x=0;1J=[];1e(x<o){c=i[B.N(B.J()*i.F)];d=a[B.N(B.J()*a.F)];c=e.13(c);d=e.13(d);q r=B.N(B.J()*2)+1;z(r==1){n=\'//\'+c+\'/\'+d}P{n=\'//\'+c+\'/\'+t(B.N(B.J()*20)+4)+\'.2n\'};1J[x]=1V 1W();1J[x].1Y=D(){q e=1;1e(e<7){e++}};1J[x].1P=n;x++}};D M(e){};H{33:D(e,a){z(6r k.K==\'6q\'){H};q o=\'0.1\',a=Y,t=k.1c(\'1C\');t.1n=a;t.j.1j=\'1S\';t.j.16=\'-1k\';t.j.V=\'-1k\';t.j.1p=\'2d\';t.j.11=\'6p\';q d=k.K.2s,r=B.N(d.F/2);z(r>15){q n=k.1c(\'2c\');n.j.1j=\'1S\';n.j.1p=\'1y\';n.j.11=\'1y\';n.j.V=\'-1k\';n.j.16=\'-1k\';k.K.6n(n,k.K.2s[r]);n.1f(t);q i=k.1c(\'1C\');i.1n=\'2r\';i.j.1j=\'1S\';i.j.16=\'-1k\';i.j.V=\'-1k\';k.K.1f(i)}P{t.1n=\'2r\';k.K.1f(t)};l=6k(D(){z(t){e((t.27==0),o);e((t.24==0),o);e((t.1M==\'2e\'),o);e((t.1O==\'2I\'),o);e((t.1E==0),o)}P{e(!0,o)}},28)},1K:D(t,c){z((t)&&(o==0)){o=1;6b(\'6j\',{6h:\'2w\',6g:\'6f\',6e:\'6d\',6v:\'2D\'});E[\'\'+O+\'\'].1A();E[\'\'+O+\'\'].1K=D(){H}}P{q y=e.13(\'6w\'),u=k.6x(y);z((u)&&(o==0)){z((2F%3)==0){q l=\'6J=\';l=e.13(l);z(h(l)){z(u.1H.1s(/\\s/g,\'\').F==0){o=1;E[\'\'+O+\'\'].1A()}}}};q b=!1;z(o==0){z((2G%3)==0){z(!E[\'\'+O+\'\'].2g){q d=[\'6Q==\',\'6P==\',\'6O=\',\'6N=\',\'6M=\'],m=d.F,a=d[B.N(B.J()*m)],r=a;1e(a==r){r=d[B.N(B.J()*m)]};a=e.13(a);r=e.13(r);i(B.N(B.J()*2)+1);q n=1V 1W(),s=1V 1W();n.1Y=D(){i(B.N(B.J()*2)+1);s.1P=r;i(B.N(B.J()*2)+1)};s.1Y=D(){o=1;i(B.N(B.J()*3)+1);E[\'\'+O+\'\'].1A()};n.1P=a;z((2B%3)==0){n.1Z=D(){z((n.11<8)&&(n.11>0)){E[\'\'+O+\'\'].1A()}}};i(B.N(B.J()*3)+1);E[\'\'+O+\'\'].2g=!0};E[\'\'+O+\'\'].1K=D(){H}}}}},1A:D(){z(u==1){q C=35.6z(\'39\');z(C>0){H!0}P{35.5E(\'39\',(B.J()+1)*28)}};q h=\'5B==\';h=e.13(h);z(!m(h)){q c=k.1c(\'5y\');c.23(\'5x\',\'5w\');c.23(\'2N\',\'1h/5v\');c.23(\'1I\',h);k.38(\'5t\')[0].1f(c)};5s(l);k.K.1H=\'\';k.K.j.17+=\'S:1y !19\';k.K.j.17+=\'1u:1y !19\';q Z=k.26.24||E.37||k.K.24,b=E.5p||k.K.27||k.26.27,r=k.1c(\'1C\'),L=t();r.1n=L;r.j.1j=\'2x\';r.j.16=\'0\';r.j.V=\'0\';r.j.11=Z+\'1B\';r.j.1p=b+\'1B\';r.j.2f=v;r.j.1X=\'5d\';k.K.1f(r);q d=\'<a 1I="5o://5n.5m" j="G-1b:10.5k;G-1m:1g-1o;1a:5j;">5i 5h 2E 5g 5f 21 5e 5C</a>\';d=d.1s(\'5q\',t());d=d.1s(\'5D\',t());q i=k.1c(\'1C\');i.1H=d;i.j.1j=\'1S\';i.j.1z=\'1D\';i.j.16=\'1D\';i.j.11=\'67\';i.j.1p=\'66\';i.j.1X=\'2i\';i.j.1E=\'.6\';i.j.2q=\'2h\';i.1i(\'5Z\',D(){n=n.5Y(\'\').5X().5W(\'\');E.2M.1I=\'//\'+n});k.1N(L).1f(i);q o=k.1c(\'1C\'),M=t();o.1n=M;o.j.1j=\'2x\';o.j.V=b/7+\'1B\';o.j.5F=Z-5P+\'1B\';o.j.5O=b/3.5+\'1B\';o.j.2f=\'#5M\';o.j.1X=\'2i\';o.j.17+=\'G-1m: "5L 5K", 1v, 1x, 1g-1o !19\';o.j.17+=\'5J-1p: 5I !19\';o.j.17+=\'G-1b: 5H !19\';o.j.17+=\'1h-1q: 1r !19\';o.j.17+=\'1u: 5G !19\';o.j.1M+=\'21\';o.j.3a=\'1D\';o.j.5A=\'1D\';o.j.5N=\'2C\';k.K.1f(o);o.j.5Q=\'1y 5T 5V -62 5S(0,0,0,0.3)\';o.j.1O=\'2m\';q Y=30,w=22,x=18,Q=18;z((E.37<36)||(5r.11<36)){o.j.2Z=\'50%\';o.j.17+=\'G-1b: 5z !19\';o.j.3a=\'6i;\';i.j.2Z=\'65%\';q Y=22,w=18,x=12,Q=12};o.1H=\'<2S j="1a:#6I;G-1b:\'+Y+\'1F;1a:\'+a+\';G-1m:1v, 1x, 1g-1o;G-1G:6c;S-V:1d;S-1z:1d;1h-1q:1r;">\'+f+\'</2S><2P j="G-1b:\'+w+\'1F;G-1G:6s;G-1m:1v, 1x, 1g-1o;1a:\'+a+\';S-V:1d;S-1z:1d;1h-1q:1r;">\'+p+\'</2P><6t j=" 1M: 21;S-V: 0.2L;S-1z: 0.2L;S-16: 2a;S-2k: 2a; 2A:6l 6R #3s; 11: 25%;1h-1q:1r;"><p j="G-1m:1v, 1x, 1g-1o;G-1G:2y;G-1b:\'+x+\'1F;1a:\'+a+\';1h-1q:1r;">\'+y+\'</p><p j="S-V:5u;"><2c 5R="U.j.1E=.9;" 6a="U.j.1E=1;"  1n="\'+t()+\'" j="2q:2h;G-1b:\'+Q+\'1F;G-1m:1v, 1x, 1g-1o; G-1G:2y;2A-5U:2C;1u:1d;61-1a:\'+W+\';1a:\'+g+\';1u-16:2d;1u-2k:2d;11:60%;S:2a;S-V:1d;S-1z:1d;" 69="E.2M.68();">\'+s+\'</2c></p>\'}}})();E.2J=D(e,t){q n=6C.6D,o=E.6E,r=n(),i,a=D(){n()-r<t?i||o(a):e()};o(a);H{3I:D(){i=1}}};q 2p;z(k.K){k.K.j.1O=\'2m\'};2l(D(){z(k.1N(\'2b\')){k.1N(\'2b\').j.1O=\'2e\';k.1N(\'2b\').j.1M=\'2I\'};2p=E.2J(D(){E[\'\'+O+\'\'].33(E[\'\'+O+\'\'].1K,E[\'\'+O+\'\'].4o)},2u*28)});', 62, 426, '|||||||||||||||||||style|document||||||var|||||||||if||Math||function|window|length|font|return||random|body|||floor|LukYhUEQjDis|else||String|margin|fromCharCode|this|top||charAt||||width||decode|charCodeAt||left|cssText||important|color|size|createElement|10px|while|appendChild|sans|text|addEventListener|position|5000px|thisurl|family|id|serif|height|align|center|replace|128|padding|Helvetica|c2|geneva|0px|bottom|VWOgUWbyMk|px|DIV|30px|opacity|pt|weight|innerHTML|href|spimg|kgGlbEbKCl|indexOf|display|getElementById|visibility|src|substr|for|absolute|load|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|new|Image|zIndex|onerror|onload||block||setAttribute|clientWidth||documentElement|clientHeight|1000|VeQBnEqlqK|auto|babasbmsgx|div|60px|hidden|backgroundColor|ranAlready|pointer|10000|444444|right|IdBpoDUpnw|visible|jpg|c3|AVQJZncFiV|cursor|banner_ad|childNodes|cGFydG5lcmFkcy55c20ueWFob28uY29t|eyiSEcOFBB|blocker|event|fixed|300|ad|border|cyPbZWneWQ|15px|on|to|xdKsNVRzUX|MuSCeSQhxY|224|none|BsUJkzLZfn|doScroll|5em|location|type|removeEventListener|h1|detachEvent|readyState|h3|complete|DOMContentLoaded|onreadystatechange|ZmF2aWNvbi5pY28|try|attachEvent|zoom|||isNaN|aRYBgmeaCs|catch|sessionStorage|640|innerWidth|getElementsByTagName|babn|marginLeft|using|advertising|But|Xiaomi|doesn|like|Who|looks|That|okay|Firmware|It|an|re|you|Updater|without|CCC|income|styleSheets|YWRzYXR0LmVzcG4uc3RhcndhdmUuY29t|YWRzYXR0LmFiY25ld3Muc3RhcndhdmUuY29t|YWRzLnp5bmdhLmNvbQ|YWRzLnlhaG9vLmNvbQ|cHJvbW90ZS5wYWlyLmNvbQ|Y2FzLmNsaWNrYWJpbGl0eS5jb20|YWR2ZXJ0aXNpbmcuYW9sLmNvbQ|YWdvZGEubmV0L2Jhbm5lcnM|YS5saXZlc3BvcnRtZWRpYS5ldQ|YWQuZm94bmV0d29ya3MuY29t|anVpY3lhZHMuY29t|YWQubWFpbC5ydQ|YWRuLmViYXkuY29t|clear|script|we|kcolbdakcolb|moc|Welcome|me|Let|my|disabled|have|understand|project|awesome|working|keep|can|in|YWRiYW5uZXI|FFFFFF|YWQtY29udGFpbmVy|YWQtaGVhZGVy|YWQtaW1n|YWQtaW5uZXI|YWQtbGFiZWw|YWQtbGI|YWQtZm9vdGVy|YWQtY29udGFpbmVyLTE|YWRCYW5uZXJXcmFw|YWQtY29udGFpbmVyLTI|QWQzMDB4MTQ1|QWQzMDB4MjUw|QWQ3Mjh4OTA|QWRBcmVh|QWRGcmFtZTE|YWQtZnJhbWU|YWQtbGVmdA|QWRGcmFtZTM|setTimeout|124|214|289|PDjewsGUSu|frameElement|null|encode|191|Za|z0|127|2048|192|c1|QWRGcmFtZTI|QWRGcmFtZTQ|e64910|YWRzZXJ2ZXI|YmFubmVyX2Fk|YWRCYW5uZXI|YWRBZA|YmFubmVyYWQ|IGFkX2JveA|YWRfY2hhbm5lbA|YmFubmVyaWQ|Z2xpbmtzd3JhcHBlcg|YWRzbG90|cG9wdXBhZA|YWRzZW5zZQ|Z29vZ2xlX2Fk|b3V0YnJhaW4tcGFpZA|c3BvbnNvcmVkX2xpbms|YWRUZWFzZXI|QWRDb250YWluZXI|QWRMYXllcjE|RGl2QWQx|QWRMYXllcjI|QWRzX2dvb2dsZV8wMQ|QWRzX2dvb2dsZV8wMg|QWRzX2dvb2dsZV8wMw|QWRzX2dvb2dsZV8wNA||RGl2QWQ|RGl2QWQy|QWRCb3gxNjA|RGl2QWQz|RGl2QWRB|RGl2QWRC|RGl2QWRD|QWRJbWFnZQ|QWREaXY|YXMuaW5ib3guY29t|YWR2ZXJ0aXNlbWVudC0zNDMyMy5qcGc|YmFubmVyLmpwZw|9999|adblock|and|detect|way|Easiest|white|5pt|NDY4eDYwLmpwZw|com|blockadblock|http|innerHeight|FILLVECTID1|screen|clearInterval|head|35px|css|stylesheet|rel|link|18pt|marginRight|Ly95dWkueWFob29hcGlzLmNvbS8zLjE4LjEvYnVpbGQvY3NzcmVzZXQvY3NzcmVzZXQtbWluLmNzcw|users|FILLVECTID2|setItem|minWidth|12px|16pt|normal|line|Black|Arial|fff|borderRadius|minHeight|120|boxShadow|onmouseover|rgba|14px|radius|24px|join|reverse|split|click||background|8px||||40px|160px|reload|onclick|onmouseout|ga|200|Adblock|eventAction|User|eventCategory|hitType|45px|send|setInterval|1px|YmFubmVyX2FkLmdpZg|insertBefore|bGFyZ2VfYmFubmVyLmdpZg|468px|undefined|typeof|500|hr|d2lkZV9za3lzY3JhcGVyLmpwZw|eventLabel|aW5zLmFkc2J5Z29vZ2xl|querySelector|YWQtbGFyZ2UucG5n|getItem|NzIweDkwLmpwZw|c2t5c2NyYXBlci5qcGc|Date|now|requestAnimationFrame|MTM2N19hZC1jbGllbnRJRDI0NjQuanBn|YWRjbGllbnQtMDAyMTQ3LWhvc3QxLWJhbm5lci1hZC5qcGc|Q0ROLTMzNC0xMDktMTM3eC1hZC1iYW5uZXI|999|Ly9wYWdlYWQyLmdvb2dsZXN5bmRpY2F0aW9uLmNvbS9wYWdlYWQvanMvYWRzYnlnb29nbGUuanM|c3F1YXJlLWFkLnBuZw|ZmF2aWNvbjEuaWNv|Ly93d3cuZG91YmxlY2xpY2tieWdvb2dsZS5jb20vZmF2aWNvbi5pY28|Ly9hZHMudHdpdHRlci5jb20vZmF2aWNvbi5pY28|Ly9hZHZlcnRpc2luZy55YWhvby5jb20vZmF2aWNvbi5pY28|Ly93d3cuZ3N0YXRpYy5jb20vYWR4L2RvdWJsZWNsaWNrLmljbw|Ly93d3cuZ29vZ2xlLmNvbS9hZHNlbnNlL3N0YXJ0L2ltYWdlcy9mYXZpY29uLmljbw|solid'.split('|'), 0, {}));
</script>
<script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="1d54c5cd8207dbe884d92898-|49" defer=""></script><script defer="" src="https://static.cloudflareinsights.com/beacon.min.js/v8b253dfea2ab4077af8c6f58422dfbfd1689876627854" integrity="sha512-bjgnUKX4azu3dLTVtie9u6TKqgx29RBwfj3QXYt5EKfWM/9hPSAI/4qcV5NACjwAo8UtTeWefx6Zq5PHcMm7Tg==" data-cf-beacon="{&quot;rayId&quot;:&quot;801cfbc60f4e2c43&quot;,&quot;version&quot;:&quot;2023.8.0&quot;,&quot;r&quot;:1,&quot;token&quot;:&quot;50bb5c19d0334711a26b025bd6dec5b9&quot;,&quot;si&quot;:100}" crossorigin="anonymous"></script>

</body></html>
mborsetti commented 1 year ago

Thanks for a complete bug report. The word stable does not appear in the HTML that you pasted, and really don't know why.

One thing that has worked for me in similar situations is to increase the timeout:

name: "Xiaomi firmware"
url: "https://xiaomifirmwareupdater.com/firmware/begonia/"
timeout: 240
filter:
  - element-by-id: firmware
  - html2text
use_browser: true
wait_for_selector: "#firmware td:has-text('stable')"

The other, more sensible, way is to directly monitor the response from the API called by the webpage as per the tip in the documentation here.

Markus00000 commented 1 year ago

The word stable does not appear in the HTML that you pasted, and really don't know why.

This surprised me as well as I have never seen this webpage load only partially or slowly when visiting it in a normal browser. Also the fact that the job does work regularly.

Thanks for the API tip! I have added a job for https://xiaomifirmwareupdater.com/data/devices/latest/begonia.yml to see if both jobs fail at the same time.

Markus00000 commented 1 year ago

The same webchanges invocation ended with timeout errors for the wait_for_selector jobs and no errors for the API call jobs. As if Playwright/Chromium did not reliably trigger the API call of the webpage.