https://www.ebay.com.au/sh/reports/downloads
Export CSV
import-csv -Path C:\Scripts\eBay-all-active-listings-report-2024-11-13-11194153212.csv -Encoding UTF8 | ForEach {
# URL to fetch the HTML
$url = 'https://www.ebay.com.au/sch/i.html?_from=R40&_nkw='+$_.Title+'&_sacat=0&_sop=15'
# Fetch the HTML content
$response = Invoke-WebRequest -Uri $url
# Regex to find the <span> with the specific class
$regex = '<span[^>]*class=["'']s-item__detail s-item__detail--secondary["''].*?>(.*?)</span>'
if ($response.Content -match $regex) {
$spanContent = $matches[1] # Extract the content of the span
if ($spanContent -like "*username*" -or $spanContent -like "*NEGATIVE BOLD*" -or $spanContent -like "*ebay-plus*") {
}
Else
{
$_.Title
Write-Output "Content of the span: $spanContent"
}
} else {
Write-Output "No <span> element with the specified class found."
}
}