Skip to content

Instantly share code, notes, and snippets.

View burgerga's full-sized avatar

Gerhard Burger burgerga

View GitHub Profile
@burgerga
burgerga / ah_to_mealie.py
Created April 7, 2024 22:54 — forked from tverlaan/ah_to_mealie.py
Mealie can't scrape ah.nl from docker, but it works elsewhere. This is a workaround to scrape recipes from ah.nl and call the mealie api to store them.
import requests
import uuid
from recipe_scrapers import scrape_html
MEALIE_TOKEN = ""
MEALIE_URL = ""
MEALIE_TAG_ID = ""
MEALIE_HEADERS = {"Authorization": "Bearer " + MEALIE_TOKEN}
AH_HEADERS = {"Accept-Language": "nl", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:124.0) Gecko/20100101 Firefox/124.0"}
<!DOCTYPE html>
<html>
<body>
<table class="wikitable sortable jquery-tablesorter" style="text-align:right">
<thead><tr>
<th rowspan="3" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Ability
</th>
<th colspan="2">Wales
</th>
<?xml version = "1.0" encoding = "UTF-8"?>
<ome:OME xmlns:ome="http://www.openmicroscopy.org/Schemas/OME/2008-09"
xmlns:STD="http://www.openmicroscopy.org/Schemas/STD/2008-09"
xmlns:Bin="http://www.openmicroscopy.org/Schemas/BinaryFile/2008-09"
xmlns:CA="http://www.openmicroscopy.org/Schemas/CA/2008-09"
xmlns:SPW="http://www.openmicroscopy.org/Schemas/SPW/2008-09"
xmlns:AML="http://www.openmicroscopy.org/Schemas/AnalysisModule/2008-09"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2008-09 http://www.openmicroscopy.org/Schemas/OME/2008-09/ome.xsd">
<ome:Instrument ID="Instrument:0">