<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://bogza.ro/index.php?action=history&amp;feed=atom&amp;title=Using_AliExpress_Scraper_And_Update_The_Wiki_Pages</id>
	<title>Using AliExpress Scraper And Update The Wiki Pages - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://bogza.ro/index.php?action=history&amp;feed=atom&amp;title=Using_AliExpress_Scraper_And_Update_The_Wiki_Pages"/>
	<link rel="alternate" type="text/html" href="https://bogza.ro/index.php?title=Using_AliExpress_Scraper_And_Update_The_Wiki_Pages&amp;action=history"/>
	<updated>2026-09-15T12:38:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.4</generator>
	<entry>
		<id>https://bogza.ro/index.php?title=Using_AliExpress_Scraper_And_Update_The_Wiki_Pages&amp;diff=1600&amp;oldid=prev</id>
		<title>TinelBot: Automation proof-of-concept update</title>
		<link rel="alternate" type="text/html" href="https://bogza.ro/index.php?title=Using_AliExpress_Scraper_And_Update_The_Wiki_Pages&amp;diff=1600&amp;oldid=prev"/>
		<updated>2025-10-06T18:20:31Z</updated>

		<summary type="html">&lt;p&gt;Automation proof-of-concept update&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Description ==&lt;br /&gt;
Using AliExpress Scraper and Updating Wiki Pages&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* Python 3.10 or newer&lt;br /&gt;
* Google Chrome installed (for Selenium rendering)&lt;br /&gt;
* ``pip install -r requirements.txt``&lt;br /&gt;
* ``playwright install chromium``&lt;br /&gt;
&lt;br /&gt;
== Scraping a Single Product ==&lt;br /&gt;
=== Run the scraper with the AliExpress product URL ===&lt;br /&gt;
``python aliexpress_scraper.py &amp;quot;https://www.aliexpress.com/item/PRODUCT_ID.html&amp;quot; --output extracted_items``&lt;br /&gt;
&lt;br /&gt;
=== Key options ===&lt;br /&gt;
* ``--show-browser`` – launch Chrome and Playwright with visible windows (solve captchas by hand).&lt;br /&gt;
* ``--output`` – where to store the extracted item folder (defaults to the current directory).&lt;br /&gt;
&lt;br /&gt;
=== Environment helpers ===&lt;br /&gt;
* ``CHROME_USER_DATA_DIR`` – path to a dedicated Chrome profile folder for automation.&lt;br /&gt;
* ``CHROME_PROFILE_DIRECTORY`` – profile name (for example ``Default``) when reusing an existing profile.&lt;br /&gt;
* ``CHROME_BINARY_PATH`` – explicit path to ``chrome.exe`` if Chrome is not on the default path.&lt;br /&gt;
&lt;br /&gt;
=== Outputs are written to ``&amp;lt;output&amp;gt;/&amp;lt;Sanitised Product Title&amp;gt;/`` with ===&lt;br /&gt;
* ``images/`` – converted JPEG product images.&lt;br /&gt;
* ``description_images/`` – assets found inside the description block.&lt;br /&gt;
* ``summary.json`` – structured metadata (title, URL, description, product_id, extracted_text).&lt;br /&gt;
* ``info.txt`` – human-readable summary.&lt;br /&gt;
* ``page.html`` and ``dom.txt`` – raw and rendered HTML snapshots.&lt;br /&gt;
&lt;br /&gt;
== Scraping Multiple URLs and Updating Wiki Pages ==&lt;br /&gt;
=== Use the pipeline helper when you want to scrape and publish in one go ===&lt;br /&gt;
``python scrape_and_publish.py &amp;lt;url1&amp;gt; &amp;lt;url2&amp;gt; --base extracted_items``&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
* ``--skip-wiki`` – only scrape.&lt;br /&gt;
* ``--dry-run`` – perform uploads in dry-run mode (no MediaWiki changes).&lt;br /&gt;
* ``--base`` – reuse an existing extraction folder.&lt;br /&gt;
&lt;br /&gt;
== Publishing Existing Folders to MediaWiki ==&lt;br /&gt;
=== Configure the following environment variables (``.env`` file supported) ===&lt;br /&gt;
* ``MEDIAWIKI_API_URL`` – e.g. ``https://wiki.example.org/w/api.php``&lt;br /&gt;
* ``MEDIAWIKI_BOT_USERNAME`` / ``MEDIAWIKI_BOT_PASSWORD`` – bot credentials.&lt;br /&gt;
* ``MEDIAWIKI_PAGE_PREFIX`` – optional namespace or prefix for generated pages.&lt;br /&gt;
* ``MEDIAWIKI_USER_AGENT`` – contact string for your automation client.&lt;br /&gt;
* ``MEDIAWIKI_EDIT_SUMMARY`` – edit summary used for page saves.&lt;br /&gt;
&lt;br /&gt;
=== Then run ===&lt;br /&gt;
``python create_wiki_pages.py extracted_items``&lt;br /&gt;
&lt;br /&gt;
=== The script will ===&lt;br /&gt;
# Load configuration from the environment (or ``.env``).&lt;br /&gt;
# Collect each subfolder under the base directory.&lt;br /&gt;
# Upload any ``images/`` and ``description_images/`` files (skipping duplicates).&lt;br /&gt;
# Format ``description.txt`` into wiki markup and create/update pages.&lt;br /&gt;
&lt;br /&gt;
== Workflow Tips ==&lt;br /&gt;
* Keep ``extracted_items/`` under version control ignore (already added to ``.gitignore``).&lt;br /&gt;
* Use ``--show-browser`` if AliExpress challenges you with captchas; the scraper waits for you to solve them.&lt;br /&gt;
* Regenerate wiki pages after editing ``description.txt`` by re-running ``create_wiki_pages.py``.&lt;br /&gt;
* For auditing, inspect ``summary.json`` and ``info.txt`` before publishing.&lt;br /&gt;
* Combine ``scrape_and_publish.py`` with a text file of URLs for batch imports.&lt;/div&gt;</summary>
		<author><name>TinelBot</name></author>
	</entry>
</feed>