Hilfe: Suchfunktion einer Website mit Powershell bedienen

Hallo zusammen,

ich würde gerne wissen, wie ich mit Powershell eine Suche auf einer Seite durchführe.

Die Seite heißt Hotbath.nl

Das Programm müsste ein Keywoard in der suche eingeben und dann das erste Ergebnis auswählen.

Ich schaffe es leider aus eigener Kraft nicht das zu lösen.

$URI = "https://www.hotbath.nl/?s="
$HTML = Invoke-WebRequest -Uri $URI
$HTML.AllElements

$SearchField = $HTML.ParsedHtml.getElementsById('top-menu')
$SearchField.value = "FKM19BB"
$SearchButton = $HTML.ParsedHtml.getElementsByName('nav')
$SearchButton.click();
//Grab links and store into array

Ich habe dazu das hier im Internet gefunden und versucht es anzupassen.
Vlt. kann mir einer von euch weiterhelfen.

Danke schon mal im voraus und Gruß an alle.

Max,
Welcome to the forum. :wave:t4:

Dieses ist ein rein englisch-sprachiges Forum. Entweder Du übersetzt Deine Anfrage ins Englische oder Du wendest Dich an ein Deutsch-sprachiges Forum wie
https://social.technet.microsoft.com/forums/de-DE/home?forum=powershell_de
oder

Danke schon mal im Voraus

Regardless of that … you know you just have to extend the search uri with the search pattern you’re looking for, don’t you? :wink:

So if you’re looking for "FKM19BB" and the uri is "https://www.hotbath.nl/?s=" you can use

$URI = "https://www.hotbath.nl/?s=FKM19BB"
$HTML = Invoke-WebRequest -Uri $URI

and you should have the result page. Now you just have to extract the result you need. :wink: