Using the swedish yellow pages service Eniro I could use powershell to get the information.
This script only gets the first result with homepage attribut added, but depending on what you put the results may vary.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ping-company { | |
param( | |
$profile = "<profileName>", | |
$key = "<apiKey>", | |
$version = "1.1.3", | |
$searchWord | |
) | |
$url = "https://api.eniro.com/cs/search/basic?profile=$($profile)&key=$($key)&country=se&version=$($version)&search_word=$($searchWord)" | |
$result = Invoke-RestMethod -Uri $url | |
$queryResult = $result.adverts |where-object {![string]::IsNullOrEmpty($_.homepage)} |select -first 1 | |
$request = Invoke-WebRequest -Uri $queryResult.homepage | |
$homepage = (($($request.ParsedHtml.getElementsByTagName("meta")|select -ExpandProperty content)).split(";")|where-object {$_ -like "url=*"}).replace("url=","") | |
return $homepage | |
} | |
$searchWord = "Lantmännen" | |
$searchWord = [System.Web.HttpUtility]::UrlEncode($searchWord) | |
ping-company -searchWord $searchWord |