## 2 Methodology
### Web Data Extraction  
With the domains collected, the task at hand was to infer the country more closely related to each website. In order to reach a trustworthy conclusion concerning the main country of origin of a website, a data series was collected regarding the various aspects of the website's online presence. The main tool for collecting this information was Web data extraction (or Web scraping). Table 1 presents the various variables that the Web data extraction algorithm recorded, with their types, multiplicity, and a description of each variable. These variables were selected based on the feasibility of their collection and their relevance to the goal of establishing a website's country of origin and are based around both technical characteristics of the hosting process and website content in terms of hyperlinks and language usage. In order to detect the country of the host of the website (_server_country_) the algorithm makes use of the GeoLite2 PHP library by MaxMind with the latest database update. The GeoLite2 databases are free IP geolocation databases provided by MaxMIND [29] and were used through an implementation of their PHP API [30]. Other country code TLDs (ccTLDs) having a registered and functioning domain with the same SLDs were detected through HTTP requests and recorded in the _other_domain_countries_ variable. To collect the information regarding a website's registrar (_registrar_, _registrar_web_country_, _registrar_web_lang_) the algorithm extracted the registrar's URL from the EURid website. EURid is the regulatory institution responsible for the usage of the.eu TLD as it has been designated by the European Commission. The EURid website offers \"whois\" functionality that reports the registrar of any.eu website and that registrar's Web page. After collecting the registrar's website, the data extraction algorithm recorded its ccTLD if it belonged to an EU member state and proceeded to scrape its home page in order to detect the language used there. Figure 3: Flowchart of the.eu domains discovery algorithm. The language detection was carried out by a subroutine making use of the language-detection PHP library by [PERSON] [31]. This subroutine analyzed the Web page's DOM structure and collected text strings from the title element, the meta description tag and any text elements in the page's body such as paragraphs, lists, and so on. If the page presented adequate text content (more than 150 characters) the language of that content was inferred and recorded in the database. Following that, the crawling algorithm proceeded to scrape the homepage of the website being investigated. It used the language detection subroutine as presented above to infer the language used (_page_detected_lang_). Additionally, the text elements of the homepage were investigated for any appearance of an EU country name in English and each instance was recorded in the _addr_detected_countries_str_ variable. The next step in data collection was to search the homepage's DOM for all anchor elements and collect their links. If an EU country's ccTLD was detected in a _mailto_: link, that country was added to the _mail_countries_str_ variable. If an EU country's area telephone code was detected in a _tel:_ link, that country was added to the _phone_countries_str_ variable. The function of detecting the area code and extracting the appropriate country code was performed by a subroutine that made use of the libronibenumber-for-php PHP library from [PERSON], that was based on Google's libphonenumber Java, C++, and Javascript library [32]. Finally, the algorithm identified any google map links present in the homepage. If such a link was found, it was recorded in the _gmap_link_ variable. With all homepage links collected, the crawling algorithm proceeded to scrape all internal Web pages that appeared as links in the homepage up to a maximum of 100 pages. The maximum limit was instated to ensure a reasonable maximum amount of time required to investigate a single website.