Skip to content

Python Script to collect leads from Cimbo

DataExtractProspecting.py
5.2 KB

German

So führst du das Skript unter Windows aus

Folge diesen Schritten, um das Skript auf einem Windows-Computer einzurichten und auszuführen:

Schritt 1: Python installieren

Python herunterladen: Gehe auf die und lade den neuesten Installer für Windows herunter.
Python installieren:
Aktiviere während der Installation die Option „Add Python to PATH“, damit du Python direkt aus der Eingabeaufforderung verwenden kannst.
Verwende die Standardeinstellungen, um die Installation abzuschließen.
Python-Installation überprüfen:
Öffne die Eingabeaufforderung (Command Prompt) und führe folgenden Befehl aus:
Es sollte die installierte Python-Version angezeigt werden.

Schritt 2: Benötigte Python-Bibliotheken installieren

Öffne die Eingabeaufforderung.
Installiere die benötigten Bibliotheken, indem du diesen Befehl ausführst:
Stelle sicher, dass du Selenium in Version 4.10.0 oder neuer verwendest, da diese Version Chrome's integrierten WebDriver unterstützt.

Schritt 3: Chrome-Version sicherstellen (115 oder höher)

Deine Chrome-Version prüfen:
Öffne Google Chrome.
Gehe zu chrome://settings/help.
Überprüfe, ob die Version 115 oder neuer ist.
Chrome aktualisieren (falls nötig):
Wenn deine Version unter 115 liegt:
Gehe zu chrome://settings/help.
Chrome sucht automatisch nach Updates und fordert dich auf, die neueste Version zu installieren.
Starte den Browser nach dem Update neu.
Integrierter WebDriver in Chrome:
Ab Chrome-Version 115 ist der WebDriver bereits integriert. Du musst keinen separaten chromedriver.exe installieren.

Schritt 4: Skript ausführen

Zum Skript-Verzeichnis wechseln:
Öffne die Eingabeaufforderung und navigiere in den Ordner, in dem dein Skript gespeichert ist:
2. Skript ausführen:
Starte das Skript mit folgendem Befehl:
Ersetze skript_name.py mit dem tatsächlichen Namen deines Skripts (z. B. DataExtractProspecting.py).

Schritt 5: Ergebnis überprüfen

Das Skript öffnet ein Chrome-Browserfenster, das von Selenium gesteuert wird.
Nach Abschluss wird die extrahierte Daten als CSV-Datei gespeichert, z. B. YYYY-MM-DD-Optiker-StGallen.csv.
Die Datei wird im selben Ordner gespeichert wie das Skript.

English

How to Run the Script on Windows

Follow these steps to set up and execute the script on a Windows machine:

Step 1: Install Python

Download Python:
Visit the and download the latest Python installer for Windows.
Install Python:
During installation, check the box that says "Add Python to PATH" to make it accessible from the command prompt.
Proceed with the installation using the default settings.
Verify Python Installation:
Open the Command Prompt and run:
This should return the installed Python version.

Step 2: Install Required Python Libraries

Open the Command Prompt.
Install the required libraries by running:
Ensure you’re using Selenium 4.10.0 or later, which supports Chrome’s built-in WebDriver.

Step 3: Ensure Chrome Version 115 or Higher

Check Your Chrome Version:
Open Google Chrome.
Navigate to chrome://settings/help.
Verify that your version is 115 or later.
Update Chrome (if necessary):
If your Chrome version is below 115:
Go to chrome://settings/help.
Chrome will automatically check for updates and prompt you to install the latest version.
Restart the browser after updating.
Chrome’s Built-In WebDriver:
Chrome 115 and newer versions include a built-in WebDriver. There’s no need to install a separate chromedriver.exe.

Step 4: Run the Script

Navigate to the Script Directory:
Open the Command Prompt and navigate to the folder where your script is saved:
2. Run the Script:
Execute the script with:
Replace script_name.py with the actual name of your script (e.g., DataExtractProspecting.py).

Step 5: Review the Output

The script will open a Chrome browser window controlled by Selenium.
Once complete, it will save the data in a CSV file named like YYYY-MM-DD-Optiker-StGallen.csv.
The file will be saved in the same directory as the script.


Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.