eu crawler with xml now and crawler for all projects
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 31 KiB |
+25
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"BMBF": {
|
||||
"Förderkennzeichen": "/html/body/div[1]/div/div/div[1]/div[+++2+++]/div[2]",
|
||||
"Thema": "/html/body/div[1]/div/div/div[1]/div[+++4+++]/div[2]",
|
||||
"Ressort": "/html/body/div[1]/div/div/div[1]/div[+++6+++]/div[2]",
|
||||
"Laufzeit": "/html/body/div[1]/div/div/div[1]/div[+++8+++]/div[2]",
|
||||
"Förderart": "/html/body/div[1]/div/div/div[1]/div[+++10+++]/div[2]",
|
||||
"Zuwendungsempfänger": "/html/body/div[1]/div/div/div[1]/div[+++12+++]/div[2]",
|
||||
"Verbund": "/html/body/div[1]/div/div/div[1]/div[+++3+++]/div[2]",
|
||||
"Fördersumme": "/html/body/div[1]/div/div/div[1]/div[+++5+++]/div[2]",
|
||||
"Projektträger": "/html/body/div[1]/div/div/div[1]/div[+++7+++]/div[2]",
|
||||
"Leistungsplansystematik": "/html/body/div[1]/div/div/div[1]/div[+++9+++]/div[2]",
|
||||
"Förderprofil": "/html/body/div[1]/div/div/div[1]/div[+++11+++]/div[2]",
|
||||
"Ausführende Stelle": "/html/body/div[1]/div/div/div[1]/div[+++13+++]/div[2]",
|
||||
"with_second_option": "1"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+208
@@ -0,0 +1,208 @@
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from random import randint
|
||||
import time
|
||||
import json
|
||||
import sys
|
||||
from elasticsearch import Elasticsearch
|
||||
|
||||
es = Elasticsearch({'host':'inse.nes.uni-due.de', 'port': 443, 'path_prefix':'elastic', 'scheme':'https'}, basic_auth=('elastic', 'RLldUaJgbGeoqd3KCX3p'), request_timeout=60, max_retries=5, retry_on_timeout=True)
|
||||
|
||||
def crawl_data(key, link, config, driver):
|
||||
driver.get(link)
|
||||
|
||||
time.sleep(randint(10, 20))
|
||||
|
||||
keys = list(config)
|
||||
|
||||
data = {}
|
||||
data["source"] = key
|
||||
data["link"] = link
|
||||
|
||||
is_second_option = False
|
||||
infinity_counter = 0
|
||||
while True:
|
||||
path = config[keys[0]]
|
||||
try:
|
||||
path_1 = path
|
||||
while "+++" in path_1:
|
||||
path_1 = path_1.replace("+++", "")
|
||||
|
||||
driver.find_element(By.XPATH, path_1).text
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
if config["with_second_option"] == "1":
|
||||
try:
|
||||
path_2 = path[:path.find("+++")] + str(int(path[path.find("+++") + 3:path.rfind("+++")]) + 1) + path[path.rfind("+++") + 3:]
|
||||
|
||||
driver.find_element(By.XPATH, path_2).text
|
||||
is_second_option = True
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
time.sleep(3)
|
||||
infinity_counter += 1
|
||||
if infinity_counter >= 100:
|
||||
print("here")
|
||||
raise Exception
|
||||
else:
|
||||
time.sleep(3)
|
||||
infinity_counter += 1
|
||||
if infinity_counter >= 100:
|
||||
print("here")
|
||||
raise Exception
|
||||
|
||||
for k in keys:
|
||||
try:
|
||||
if k == "with_second_option":
|
||||
continue
|
||||
path = config[k]
|
||||
if is_second_option:
|
||||
path = path[:path.find("+++")] + str(int(path[path.find("+++") + 3:path.rfind("+++")]) + 1) + path[path.rfind("+++") + 3:]
|
||||
while "+++" in path:
|
||||
path = path.replace("+++", "")
|
||||
sub = ""
|
||||
if path.startswith("---"):
|
||||
path = path[3:]
|
||||
sub = path[0:path.find("---")]
|
||||
path = path[path.find("---") + 3:]
|
||||
if path.startswith("..."):
|
||||
path = path[3:]
|
||||
li_counter = 1
|
||||
lis = []
|
||||
while True:
|
||||
elem = ""
|
||||
try:
|
||||
elem = driver.find_element(By.XPATH, path.replace("...", str(li_counter))).text
|
||||
li_counter += 1
|
||||
lis.append(elem)
|
||||
except NoSuchElementException as nsee:
|
||||
break
|
||||
data[k] = lis
|
||||
continue
|
||||
|
||||
elem = ""
|
||||
try:
|
||||
elem = driver.find_element(By.XPATH, path).text
|
||||
except:
|
||||
continue
|
||||
if sub != "":
|
||||
elem = elem.replace(sub, "")
|
||||
data[k] = elem
|
||||
except:
|
||||
continue
|
||||
|
||||
upload_data(key, data)
|
||||
|
||||
def check_elastic_online():
|
||||
if not es.ping():
|
||||
sys.exit("No connection to Elasticsearch")
|
||||
|
||||
def check_elastic_index(data, index_name):
|
||||
if not es.indices.exists(index=index_name):
|
||||
settings = {
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"searchabilityAnalyzer": {
|
||||
"type": "custom",
|
||||
"tokenizer": "standard",
|
||||
"filter": [
|
||||
"lowercase",
|
||||
"asciifolding"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mappings = {}
|
||||
properties = {}
|
||||
|
||||
for key in list(data.keys()):
|
||||
properties[key] = {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 256
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mappings["properties"] = properties
|
||||
|
||||
es.indices.create(index=index_name, mappings=mappings, settings=settings)
|
||||
|
||||
def upload_data(key, data):
|
||||
print("Uploading")
|
||||
index_name = "projects_" + key + "all"
|
||||
index_name = index_name.lower()
|
||||
|
||||
# add funding_start and funding_end year if possible
|
||||
if key == "BMBF":
|
||||
if data["Laufzeit"] is not None:
|
||||
if data["Laufzeit"] != "":
|
||||
if len(data["Laufzeit"]) > 8:
|
||||
data["funding_start"] = data["Laufzeit"][6:10]
|
||||
data["funding_end"] = data["Laufzeit"][-4:]
|
||||
|
||||
try:
|
||||
check_elastic_index(data, index_name)
|
||||
except Exception as e:
|
||||
print("Error while creating index")
|
||||
print(e)
|
||||
|
||||
try:
|
||||
id = data["link"].replace("/", "")
|
||||
es.index(index=index_name, id=id, document=data)
|
||||
except Exception as e:
|
||||
print("Error while uploading data")
|
||||
print(e)
|
||||
|
||||
# main - entry point
|
||||
if __name__ == '__main__':
|
||||
print("Starting")
|
||||
|
||||
check_elastic_online()
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
sys.exit("No path given. Give path to data_config.json (first) and links.json (second)")
|
||||
|
||||
with open(sys.argv[1], "r", encoding='utf-8') as json_config_file:
|
||||
json_config = json.load(json_config_file)
|
||||
|
||||
with open(sys.argv[2], "r", encoding='utf-8') as json_links_file:
|
||||
json_links = json.load(json_links_file)
|
||||
|
||||
options = Options()
|
||||
options.add_argument("--headless")
|
||||
|
||||
driver = webdriver.Firefox(options=options)
|
||||
|
||||
print("Getting data.")
|
||||
|
||||
for hit in json_links:
|
||||
key = list(hit)[0]
|
||||
|
||||
link = hit[key]
|
||||
|
||||
config = {}
|
||||
try:
|
||||
config = json_config[key]
|
||||
except KeyError:
|
||||
print(f"No Config for {key}")
|
||||
continue
|
||||
|
||||
print(f"{key} - {link}")
|
||||
|
||||
try:
|
||||
crawl_data(key, link, config, driver)
|
||||
except:
|
||||
print("Error!")
|
||||
continue
|
||||
|
||||
driver.close()
|
||||
|
||||
print("Finished")
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.common.exceptions import WebDriverException
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from selenium.webdriver.support.ui import Select
|
||||
from random import randint
|
||||
import time
|
||||
import json
|
||||
import sys
|
||||
|
||||
def crawl_links(side, data):
|
||||
options = Options()
|
||||
options.add_argument("--headless")
|
||||
|
||||
driver = webdriver.Firefox(options=options)
|
||||
|
||||
links = []
|
||||
|
||||
driver.get(side["start-url"])
|
||||
|
||||
# always wait so everything can be loaded
|
||||
time.sleep(randint(10, 20))
|
||||
|
||||
if side["long_waits"] == "True":
|
||||
|
||||
breakup_counter = 0
|
||||
while True:
|
||||
try:
|
||||
path = side["link_1"] + str(1) + side["link_2"]
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
breakup_counter = breakup_counter + 1
|
||||
if breakup_counter == 150:
|
||||
raise Exception
|
||||
time.sleep(3)
|
||||
|
||||
|
||||
if side["cookies"] == "True":
|
||||
try:
|
||||
driver.find_element(By.XPATH, side["cookies_button"].replace("'", '"')).click()
|
||||
|
||||
time.sleep(3)
|
||||
except NoSuchElementException as nsee:
|
||||
pass
|
||||
|
||||
if side["search"] == "True":
|
||||
driver.find_element(By.XPATH, side["button"]).click()
|
||||
|
||||
time.sleep(randint(10, 20))
|
||||
|
||||
selector_counter = 1
|
||||
|
||||
while True:
|
||||
try:
|
||||
counter = 1
|
||||
|
||||
while counter <= int(side["link_max"]):
|
||||
path = side["link_1"] + str(counter) + side["link_2"]
|
||||
counter += 1
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
links.append(link)
|
||||
|
||||
except NoSuchElementException as nsee:
|
||||
break
|
||||
|
||||
time.sleep(randint(1, 5))
|
||||
|
||||
if side["page_button"] == "True":
|
||||
try:
|
||||
driver.find_element(By.XPATH, side["next_page"]).click()
|
||||
|
||||
if side["long_waits"] == "False":
|
||||
time.sleep(randint(1, 5))
|
||||
else:
|
||||
breakup_counter = 0
|
||||
while True:
|
||||
try:
|
||||
path = side["link_1"] + str(1) + side["link_2"]
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
breakup_counter = breakup_counter + 1
|
||||
if breakup_counter == 150:
|
||||
raise Exception
|
||||
time.sleep(3)
|
||||
|
||||
except WebDriverException as wde:
|
||||
break
|
||||
|
||||
if side["page_selector"] == "True":
|
||||
selector = driver.find_element(By.XPATH, side["selector"].replace("'", '"'))
|
||||
all_options = selector.find_elements(By.TAG_NAME, "option")
|
||||
|
||||
if selector_counter == len(all_options):
|
||||
break
|
||||
|
||||
next_value = all_options[selector_counter].get_attribute("value")
|
||||
selector_counter += 1
|
||||
|
||||
|
||||
Select(selector).select_by_value(next_value)
|
||||
|
||||
time.sleep(randint(1, 5))
|
||||
|
||||
# close driver
|
||||
driver.close()
|
||||
|
||||
print(len(links))
|
||||
add_data(links, side["name"], data)
|
||||
|
||||
def add_data(links, name, data):
|
||||
for link in links:
|
||||
data.append({f"{name}": link})
|
||||
|
||||
def write_data(data):
|
||||
print(len(data))
|
||||
with open("links.json", "w") as f:
|
||||
json.dump(data, f)
|
||||
|
||||
# main - entry point
|
||||
if __name__ == '__main__':
|
||||
print("Starting")
|
||||
|
||||
data = []
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
sys.exit("No path given. Give path to links_config.json")
|
||||
|
||||
with open(sys.argv[1], "r", encoding='utf-8') as json_file:
|
||||
json_loaded = json.load(json_file)
|
||||
|
||||
for side in json_loaded:
|
||||
name = side["name"]
|
||||
print(f"Getting links from {name}.")
|
||||
try:
|
||||
crawl_links(side, data)
|
||||
except:
|
||||
print(f"Error while getting {name}-links. Check links_config.json!")
|
||||
|
||||
print("Writing links.")
|
||||
write_data(data)
|
||||
|
||||
print("Finished")
|
||||
File diff suppressed because one or more lines are too long
+16
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"name": "BMBF",
|
||||
"start-url": "https://foerderportal.bund.de/foekat/jsp/SucheAction.do?actionMode=searchmask",
|
||||
"cookies": "False",
|
||||
"search": "True",
|
||||
"button": "/html/body/div[1]/div/div/form[1]/div/fieldset/table/tbody/tr[1]/td[2]/input",
|
||||
"page_button": "False",
|
||||
"page_selector": "True",
|
||||
"selector": "//*[@id='listselect_suche_listrowfrom']",
|
||||
"link_max": "10",
|
||||
"link_1": "/html/body/div[1]/div/div/div[2]/table/tbody/tr[",
|
||||
"link_2": "]/td[1]/a[1]",
|
||||
"long_waits": "False"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,264 @@
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.common.exceptions import WebDriverException
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from random import randint
|
||||
import time
|
||||
import sys
|
||||
from elasticsearch import Elasticsearch
|
||||
|
||||
es = Elasticsearch({'host':'inse.nes.uni-due.de', 'port': 443, 'path_prefix':'elastic', 'scheme':'https'}, basic_auth=('elastic', 'RLldUaJgbGeoqd3KCX3p'), request_timeout=60, max_retries=5, retry_on_timeout=True)
|
||||
|
||||
def does_elem_exist(driver, xpath):
|
||||
try:
|
||||
driver.find_element(By.XPATH, xpath)
|
||||
except NoSuchElementException:
|
||||
return False
|
||||
return True
|
||||
|
||||
def getLinks(driver):
|
||||
print("Starting first level.")
|
||||
project_links = []
|
||||
|
||||
index_counter = 0
|
||||
dfg_link_all_1 = "https://gepris.dfg.de/gepris/OCTOPUS?beginOfFunding=&bewilligungsStatus=&bundesland=DEU%23&context=projekt&einrichtungsart=-1&fachgebiet=%23&findButton=historyCall&gefoerdertIn=&ggsHunderter=0&hitsPerPage=50&index="
|
||||
dfg_link_all_2 = "&nurProjekteMitAB=false&oldGgsHunderter=0&oldfachgebiet=%23&pemu=%23&task=doKatalog&teilprojekte=true&zk_transferprojekt=false"
|
||||
|
||||
while True:
|
||||
dfg_link_all = dfg_link_all_1 + str(index_counter) + dfg_link_all_2
|
||||
index_counter = index_counter + 50
|
||||
|
||||
driver.get(dfg_link_all)
|
||||
|
||||
time.sleep(randint(10,15))
|
||||
|
||||
infinity_counter = 0
|
||||
while True:
|
||||
try:
|
||||
driver.find_element(By.XPATH, "/html/body/div[1]/div/div[3]/div[1]/div/div/h1")
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
infinity_counter += 1
|
||||
time.sleep(3)
|
||||
if infinity_counter >= 100:
|
||||
driver.get(dfg_link_all)
|
||||
infinity_counter = 0
|
||||
|
||||
# cookies
|
||||
try:
|
||||
driver.find_element(By.XPATH, '//*[@id="c-s-bn"]').click()
|
||||
time.sleep(randint(1,3))
|
||||
except:
|
||||
pass
|
||||
|
||||
# check if side exists, if not -> break loop (all links found)
|
||||
try:
|
||||
text = driver.find_element(By.XPATH, "/html/body/div[1]/div/div[3]/div[1]/div/div/div[2]/div/p").text
|
||||
if text == "Ihre Suche ergab leider keine Treffer.":
|
||||
break
|
||||
except:
|
||||
pass
|
||||
|
||||
# get project_links
|
||||
project_counter = 1
|
||||
while project_counter <= 50:
|
||||
try:
|
||||
path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[1]/div/div[2]/div[3]/div[" + str(project_counter) + "]/div[3]/p/a"
|
||||
project_counter += 1
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
project_links.append( "https://gepris.dfg.de" + link)
|
||||
except:
|
||||
break
|
||||
|
||||
return project_links
|
||||
|
||||
def project_level(driver, project_links):
|
||||
print("Starting project level.")
|
||||
|
||||
data_list = []
|
||||
data_names = ["path", "id", "link", "title", "description", "funding_start", "funding_end", "person_creater_name", "person_creater_address"]
|
||||
|
||||
hit_counter = 0
|
||||
for hit in project_links:
|
||||
try:
|
||||
print(hit_counter)
|
||||
hit_counter += 1
|
||||
|
||||
driver.get(hit["link"])
|
||||
|
||||
time.sleep(randint(10,15))
|
||||
|
||||
infinity_counter = 0
|
||||
while True:
|
||||
try:
|
||||
driver.find_element(By.XPATH, "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[1]/h1")
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
infinity_counter += 1
|
||||
time.sleep(3)
|
||||
if infinity_counter >= 100:
|
||||
driver.get(hit["link"])
|
||||
infinity_counter = 0
|
||||
except WebDriverException as wde:
|
||||
infinity_counter += 1
|
||||
time.sleep(3)
|
||||
if infinity_counter >= 100:
|
||||
driver.get(hit["link"])
|
||||
infinity_counter = 0
|
||||
|
||||
# cookies
|
||||
try:
|
||||
driver.find_element(By.XPATH, '//*[@id="c-s-bn"]').click()
|
||||
time.sleep(randint(1,3))
|
||||
except:
|
||||
pass
|
||||
|
||||
# extend all elements
|
||||
elems = driver.find_elements(By.XPATH, 'html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]//ins[@class="jstree-icon"]')
|
||||
for e in elems:
|
||||
try:
|
||||
e.click()
|
||||
except:
|
||||
continue
|
||||
|
||||
# get infos
|
||||
data = {}
|
||||
data["path"] = hit["path"]
|
||||
data["link"] = hit["link"]
|
||||
data["id"] = hit["link"][hit["link"].rfind("/") + 1:]
|
||||
|
||||
data["title"] = driver.find_element(By.XPATH, "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[1]/h1").text.replace("\n", " ")
|
||||
data["description"] = driver.find_element(By.XPATH, '//*[@id="projekttext"]').text.replace("\n", " ")
|
||||
|
||||
# upper details
|
||||
elem_counter = 1
|
||||
elem_path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[1]/div[" + str(elem_counter) + "]"
|
||||
while does_elem_exist(driver, elem_path):
|
||||
try:
|
||||
if driver.find_element(By.XPATH, elem_path + "/span[1]").text.replace("\n", " ") not in data_names:
|
||||
data_names.append(driver.find_element(By.XPATH, elem_path + "/span[1]").text.replace("\n", " "))
|
||||
data[driver.find_element(By.XPATH, elem_path + "/span[1]").text.replace("\n", " ")] = driver.find_element(By.XPATH, elem_path + "/span[2]").text.replace("\n", " ")
|
||||
|
||||
elem_counter += 1
|
||||
elem_path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[1]/div[" + str(elem_counter) + "]"
|
||||
except:
|
||||
elem_counter += 1
|
||||
elem_path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[1]/div[" + str(elem_counter) + "]"
|
||||
|
||||
# lower details
|
||||
elem_counter = 2
|
||||
elem_path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[3]/div[1]/div[" + str(elem_counter) + "]"
|
||||
while does_elem_exist(driver, elem_path):
|
||||
try:
|
||||
if driver.find_element(By.XPATH, elem_path + "/span[1]").text.replace("\n", " ") not in data_names:
|
||||
data_names.append(driver.find_element(By.XPATH, elem_path + "/span[1]").text.replace("\n", " "))
|
||||
data[driver.find_element(By.XPATH, elem_path + "/span[1]").text.replace("\n", " ")] = driver.find_element(By.XPATH, elem_path + "/span[2]").text.replace("\n", " ")
|
||||
|
||||
elem_counter += 1
|
||||
elem_path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[3]/div[1]/div[" + str(elem_counter) + "]"
|
||||
except:
|
||||
elem_counter += 1
|
||||
elem_path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[3]/div[1]/div[" + str(elem_counter) + "]"
|
||||
|
||||
# get funding_start and funding_end year if possible
|
||||
keysList = list(data.keys())
|
||||
if "Förderung" in keysList:
|
||||
if "seit" in data["Förderung"]:
|
||||
data["funding_start"] = data["Förderung"][-4:]
|
||||
data["funding_end"] = "2999"
|
||||
elif "in" in data["Förderung"]:
|
||||
data["funding_start"] = data["Förderung"][-4:]
|
||||
data["funding_end"] = data["Förderung"][-4:]
|
||||
elif "von" in data["Förderung"]:
|
||||
data["funding_start"] = data["Förderung"][-13:-9]
|
||||
data["funding_end"] = data["Förderung"][-4:]
|
||||
|
||||
# get linked person details
|
||||
try:
|
||||
driver.find_element(By.XPATH, "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[1]/div[1]/span[2]/a").click()
|
||||
|
||||
time.sleep(randint(5,10))
|
||||
|
||||
data["person_creater_name"] = driver.find_element(By.XPATH, "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/h1").text
|
||||
data["person_creater_address"] = driver.find_element(By.XPATH, "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[1]/p[1]/span[2]").text.replace("\n", " ")
|
||||
except:
|
||||
pass
|
||||
|
||||
data_list.append(data)
|
||||
except:
|
||||
continue
|
||||
|
||||
# upload infos
|
||||
print("Uploading")
|
||||
index_name = "projects_dfg_all"
|
||||
check_elastic_index(data_names, index_name)
|
||||
|
||||
for data_hit in data_list:
|
||||
try:
|
||||
es.index(index=index_name, id=data_hit["id"], document=data_hit)
|
||||
except Exception as e:
|
||||
print("Error while uploading!")
|
||||
print(e)
|
||||
continue
|
||||
|
||||
def check_elastic_index(data_names, index_name):
|
||||
if not es.indices.exists(index=index_name):
|
||||
settings = {
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"searchabilityAnalyzer": {
|
||||
"type": "custom",
|
||||
"tokenizer": "standard",
|
||||
"filter": [
|
||||
"lowercase",
|
||||
"asciifolding"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mappings = {}
|
||||
properties = {}
|
||||
|
||||
for name in data_names:
|
||||
properties[name] = {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 256
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mappings["properties"] = properties
|
||||
|
||||
es.indices.create(index=index_name, mappings=mappings, settings=settings)
|
||||
|
||||
def check_elastic_online():
|
||||
if not es.ping():
|
||||
sys.exit("No connection to Elasticsearch")
|
||||
|
||||
# main - entry point
|
||||
if __name__ == '__main__':
|
||||
print("Starting")
|
||||
|
||||
check_elastic_online()
|
||||
|
||||
options = Options()
|
||||
options.add_argument("--headless")
|
||||
|
||||
driver = webdriver.Firefox(options=options)
|
||||
|
||||
project_links = getLinks(driver)
|
||||
|
||||
print("Number of projects: " + str(len(project_links)))
|
||||
|
||||
project_level(driver, project_links)
|
||||
|
||||
driver.close()
|
||||
|
||||
print("Finished")
|
||||
@@ -0,0 +1,365 @@
|
||||
1693491227867 geckodriver INFO Listening on 127.0.0.1:52786
|
||||
1693491230895 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "527 ... 7" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileAPEHB0"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693491231189 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693491231253 Marionette INFO Listening on port 52810
|
||||
WebDriver BiDi listening on ws://127.0.0.1:52787
|
||||
Read port: 52810
|
||||
1693491231438 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:52787/devtools/browser/191dedc7-efdf-4316-ad2e-cd71e25485c6
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
1693497339932 geckodriver INFO Listening on 127.0.0.1:65110
|
||||
1693497342957 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "651 ... 1" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileKj5yCJ"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693497343254 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693497343315 Marionette INFO Listening on port 65119
|
||||
WebDriver BiDi listening on ws://127.0.0.1:65111
|
||||
Read port: 65119
|
||||
1693497344112 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:65111/devtools/browser/3e8a7f8e-6f2d-4e6c-a4f3-fb61f6d68421
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
1:51464
|
||||
1693500403321 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "514 ... 5" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileYybVlP"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693500403655 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693500403714 Marionette INFO Listening on port 51473
|
||||
WebDriver BiDi listening on ws://127.0.0.1:51465
|
||||
Read port: 51473
|
||||
1693500403891 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:51465/devtools/browser/522a69c9-51b2-4cd6-8c14-2e3fe0c4e1ca
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
Error reading incoming packet: (InternalError: too much recursion - JSONPacket.fromHeader@chrome://remote/content/marionette/packets.sys.mjs:136:35
|
||||
Packet.fromHeader@chrome://remote/content/marionette/packets.sys.mjs:80:16
|
||||
_processIncoming@chrome://remote/content/marionette/transport.sys.mjs:406:38
|
||||
onInputStreamReady@chrome://remote/content/marionette/transport.sys.mjs:362:14
|
||||
)
|
||||
1693512395911 geckodriver INFO Listening on 127.0.0.1:62744
|
||||
1693512398933 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "627 ... 5" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileHaAcUE"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693512399233 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693512399301 Marionette INFO Listening on port 62754
|
||||
WebDriver BiDi listening on ws://127.0.0.1:62745
|
||||
Read port: 62754
|
||||
1693512399504 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:62745/devtools/browser/d855dd0a-7032-4e1c-9f2a-2b15b19a1b1b
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
1:63183
|
||||
1693512855885 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "631 ... 4" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileTlEqPA"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693512856186 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693512856246 Marionette INFO Listening on port 63192
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63184
|
||||
Read port: 63192
|
||||
1693512856424 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63184/devtools/browser/f8c0aa57-e6a5-4970-9edd-d36cf1d224ad
|
||||
console.error: ({})
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
console.error: ({})
|
||||
console.error: ({})
|
||||
console.error: ({})
|
||||
console.error: ({})
|
||||
console.error: ({})
|
||||
console.error: ({})
|
||||
console.error: ({})
|
||||
JavaScript error: https://gepris.dfg.de/gepris/js/jquery-1.8.3.js, line 1: SyntaxError: expected expression, got '<'
|
||||
JavaScript error: https://gepris.dfg.de/gepris/js/jquery.jstree.js, line 1: SyntaxError: expected expression, got '<'
|
||||
JavaScript error: https://gepris.dfg.de/gepris/js/send_preferences.js, line 1: SyntaxError: expected expression, got '<'
|
||||
JavaScript error: https://gepris.dfg.de/gepris/js/jquery-ui.js, line 1: SyntaxError: expected expression, got '<'
|
||||
JavaScript error: https://gepris.dfg.de/gepris/js/forms.js, line 1: SyntaxError: expected expression, got '<'
|
||||
console.error: ({})
|
||||
1693561625453 Marionette INFO Stopped listening on port 63192
|
||||
Dynamically enable window occlusion 1
|
||||
1693807892285 geckodriver INFO Listening on 127.0.0.1:63632
|
||||
1693807895342 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "636 ... 3" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilexJ62Tc"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693807895650 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693807895721 Marionette INFO Listening on port 63641
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63633
|
||||
Read port: 63641
|
||||
1693807896098 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63633/devtools/browser/9b4f01df-ae7b-4a18-adbd-ad1be7bec714
|
||||
1693808000756 geckodriver INFO Listening on 127.0.0.1:63742
|
||||
1693808003807 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "637 ... 3" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileGPHGcv"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693808004085 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693808004144 Marionette INFO Listening on port 63751
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63743
|
||||
Read port: 63751
|
||||
1693808004272 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63743/devtools/browser/8f93800c-a263-4b3b-983a-e6606b52529b
|
||||
1693808020143 Marionette INFO Stopped listening on port 63751
|
||||
Dynamically enable window occlusion 1
|
||||
1693808199525 geckodriver INFO Listening on 127.0.0.1:63889
|
||||
1693808202569 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "638 ... 0" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilePs58z9"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693808202856 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693808202916 Marionette INFO Listening on port 63898
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63890
|
||||
Read port: 63898
|
||||
1693808204815 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63890/devtools/browser/5d1a2602-ccb9-430c-ae19-3c8bc97fe2dd
|
||||
1693808221088 Marionette INFO Stopped listening on port 63898
|
||||
Dynamically enable window occlusion 1
|
||||
1693808283774 geckodriver INFO Listening on 127.0.0.1:63975
|
||||
1693808286820 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "639 ... 6" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilefnR710"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693808287099 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693808287158 Marionette INFO Listening on port 63984
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63976
|
||||
Read port: 63984
|
||||
1693808287337 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63976/devtools/browser/6fc4211f-9d72-44ce-aa35-232eb7155c8a
|
||||
1693808302992 Marionette INFO Stopped listening on port 63984
|
||||
Dynamically enable window occlusion 1
|
||||
1693808832976 geckodriver INFO Listening on 127.0.0.1:64236
|
||||
1693808836033 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "642 ... 7" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileMHEcc0"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693808836319 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693808836378 Marionette INFO Listening on port 64246
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64237
|
||||
Read port: 64246
|
||||
1693808836559 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:64237/devtools/browser/414f9f3b-50fe-4b24-bbe1-a3afcbe43642
|
||||
1693808853144 Marionette INFO Stopped listening on port 64246
|
||||
Dynamically enable window occlusion 1
|
||||
1693808903946 geckodriver INFO Listening on 127.0.0.1:64337
|
||||
1693808907008 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "643 ... 8" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileuwZiWw"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693808907300 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693808907359 Marionette INFO Listening on port 64346
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64338
|
||||
Read port: 64346
|
||||
1693808907540 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:64338/devtools/browser/6f5e69d7-6a34-4e71-8bf1-84c939910486
|
||||
1693808995610 geckodriver INFO Listening on 127.0.0.1:64425
|
||||
1693808998654 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "644 ... 6" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileeawRl1"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693808998945 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693808999005 Marionette INFO Listening on port 64434
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64426
|
||||
Read port: 64434
|
||||
1693808999257 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:64426/devtools/browser/9d5ab139-82ed-4c51-8710-4a1a37144e53
|
||||
1693809014002 Marionette INFO Stopped listening on port 64434
|
||||
Dynamically enable window occlusion 1
|
||||
1693809021349 geckodriver INFO Listening on 127.0.0.1:64483
|
||||
1693809024407 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "644 ... 4" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileeVlNoQ"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809024686 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809024746 Marionette INFO Listening on port 64492
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64484
|
||||
Read port: 64492
|
||||
1693809024930 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:64484/devtools/browser/c213fe14-9323-486b-913d-b6845b33bb1f
|
||||
1693809177340 geckodriver INFO Listening on 127.0.0.1:64602
|
||||
1693809180383 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "646 ... 3" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofile4Ud29u"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809180669 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809180731 Marionette INFO Listening on port 64611
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64603
|
||||
Read port: 64611
|
||||
1693809180915 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:64603/devtools/browser/c8c67629-7ad9-403e-be00-c6728c1edc38
|
||||
1693809197701 Marionette INFO Stopped listening on port 64611
|
||||
Dynamically enable window occlusion 1
|
||||
1693809410951 geckodriver INFO Listening on 127.0.0.1:64741
|
||||
1693809413987 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "64742" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileBNJsLr"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809414272 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809414374 Marionette INFO Listening on port 64750
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64742
|
||||
Read port: 64750
|
||||
1693809414563 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:64742/devtools/browser/032949b6-860b-4cc1-8c8a-93a556580056
|
||||
SourceActor threw an exception: Error: Failed to fetch https://gepris.dfg.de/gepris/institution/972220?context=institution&task=showDetail&id=972220&. Code 2152398879.
|
||||
Stack: onResponse@resource://devtools/shared/DevToolsUtils.js:596:16
|
||||
onStopRequest@resource://gre/modules/NetUtil.sys.mjs:124:18
|
||||
Line: 596, column: 16
|
||||
console.error: (new Error("Failed to fetch https://gepris.dfg.de/gepris/institution/972220?context=institution&task=showDetail&id=972220&. Code 2152398879.", "resource://devtools/shared/DevToolsUtils.js", 596))
|
||||
JavaScript error: resource://devtools/shared/DevToolsUtils.js, line 596: Error: Failed to fetch https://gepris.dfg.de/gepris/institution/972220?context=institution&task=showDetail&id=972220&. Code 2152398879.
|
||||
JavaScript error: resource://gre/modules/AsyncShutdown.sys.mjs, line 573: NotFoundError: No such JSWindowActor 'DevToolsFrame'
|
||||
1693809551269 Marionette INFO Stopped listening on port 64750
|
||||
Dynamically enable window occlusion 1
|
||||
1693809553276 geckodriver INFO Listening on 127.0.0.1:64861
|
||||
1693809556322 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "64862" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileYjRp92"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809556604 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809556704 Marionette INFO Listening on port 64870
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64862
|
||||
Read port: 64870
|
||||
1693809556899 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:64862/devtools/browser/ae1a1655-7d46-4f4e-b7c9-8bd09aaf0a7e
|
||||
1693809605833 Marionette INFO Stopped listening on port 64870
|
||||
Dynamically enable window occlusion 1
|
||||
ng command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "64933" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofile9jOgsl"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809606105 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809606205 Marionette INFO Listening on port 64941
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64933
|
||||
Read port: 64941
|
||||
1693809606385 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:64933/devtools/browser/0bf09717-0496-4dd7-988c-9b7a127bf0c8
|
||||
1693809701622 Marionette WARN TimedPromise timed out after 500 ms: stacktrace:
|
||||
TimedPromise/<@chrome://remote/content/marionette/sync.sys.mjs:219:24
|
||||
TimedPromise@chrome://remote/content/marionette/sync.sys.mjs:203:10
|
||||
interaction.flushEventLoop@chrome://remote/content/marionette/interaction.sys.mjs:429:10
|
||||
webdriverClickElement@chrome://remote/content/marionette/interaction.sys.mjs:178:31
|
||||
1693809731258 Marionette INFO Stopped listening on port 64941
|
||||
Dynamically enable window occlusion 1
|
||||
1693809761540 geckodriver INFO Listening on 127.0.0.1:65040
|
||||
1693809764597 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "65041" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileRw8cTX"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809764882 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809764982 Marionette INFO Listening on port 65049
|
||||
WebDriver BiDi listening on ws://127.0.0.1:65041
|
||||
Read port: 65049
|
||||
1693809765165 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:65041/devtools/browser/9ea0b7fe-35e1-4162-9789-e6cdd232e534
|
||||
1693809768622 Marionette INFO Stopped listening on port 65049
|
||||
Dynamically enable window occlusion 1
|
||||
1693809803176 geckodriver INFO Listening on 127.0.0.1:65104
|
||||
1693809806223 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "65105" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileUZdYnY"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809806507 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809806607 Marionette INFO Listening on port 65113
|
||||
WebDriver BiDi listening on ws://127.0.0.1:65105
|
||||
Read port: 65113
|
||||
1693809806794 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:65105/devtools/browser/1407ee68-83de-4891-86c2-c777191ddf9c
|
||||
1693810006863 Marionette INFO Stopped listening on port 65113
|
||||
Dynamically enable window occlusion 1
|
||||
1693810347268 geckodriver INFO Listening on 127.0.0.1:65387
|
||||
1693810350323 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "653 ... 8" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofiledt05h4"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693810350604 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693810350664 Marionette INFO Listening on port 65396
|
||||
WebDriver BiDi listening on ws://127.0.0.1:65388
|
||||
Read port: 65396
|
||||
1693810350846 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:65388/devtools/browser/8fb510ec-c007-4366-a073-929c07069cf4
|
||||
1693810419965 geckodriver INFO Listening on 127.0.0.1:65465
|
||||
1693810423008 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "654 ... 6" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilejifryk"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693810423284 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693810423343 Marionette INFO Listening on port 65474
|
||||
Read port: 65474
|
||||
WebDriver BiDi listening on ws://127.0.0.1:65466
|
||||
1693810423390 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:65466/devtools/browser/7a22f73a-7490-4df0-8f22-5d7dc08d4f83
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
JavaScript error: resource://gre/modules/PromiseWorker.sys.mjs, line 102: Error: Could not get children of file(C:\Users\voglt\AppData\Local\Temp\rust_mozprofilejifryk\thumbnails) because it does not exist
|
||||
JavaScript error: resource://gre/modules/PromiseWorker.sys.mjs, line 102: Error: Could not get children of file(C:\Users\voglt\AppData\Local\Temp\rust_mozprofilejifryk\thumbnails) because it does not exist
|
||||
JavaScript error: resource://gre/modules/PromiseWorker.sys.mjs, line 102: Error: Could not get children of file(C:\Users\voglt\AppData\Local\Temp\rust_mozprofilejifryk\thumbnails) because it does not exist
|
||||
JavaScript error: resource://gre/modules/PromiseWorker.sys.mjs, line 102: Error: Could not get children of file(C:\Users\voglt\AppData\Local\Temp\rust_mozprofilejifryk\thumbnails) because it does not exist
|
||||
1693856815253 Marionette INFO Stopped listening on port 65474
|
||||
Dynamically enable window occlusion 1
|
||||
1704373764930 geckodriver INFO Listening on 127.0.0.1:58846
|
||||
1704373767967 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "588 ... 7" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilePeC1a5"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1704373768285 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1704373768357 Marionette INFO Listening on port 58855
|
||||
WebDriver BiDi listening on ws://127.0.0.1:58847
|
||||
Read port: 58855
|
||||
1704373768536 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:58847/devtools/browser/dcf26f45-17e3-40d1-b201-eada2dc15dd8
|
||||
1704373798354 addons.xpi ERROR System addon update list error SyntaxError: XMLHttpRequest.open: 'http://%(server)s/dummy-system-addons.xml' is not a valid URL.
|
||||
console.log: "RemoteSettingsWorker error: DataError: IndexedDB: records, timestamps execute() Data provided to an operation does not meet requirements."
|
||||
console.error: (new RemoteSettingsWorkerError("DataError: IndexedDB: records, timestamps execute() Data provided to an operation does not meet requirements.", "resource://services-settings/RemoteSettingsWorker.sys.mjs", 34))
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
1704420737107 Marionette INFO Stopped listening on port 58855
|
||||
Dynamically enable window occlusion 1
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"EU": {
|
||||
"Title": "/html/body/div[6]/div[3]/div/aside/div/div[2]/div[1]/div[1]",
|
||||
"ID": "/html/body/div[6]/div[3]/div/aside/div/div[2]/div[1]/div[2]",
|
||||
"Start": "---Start date\n---/html/body/div[6]/div[3]/div/aside/div/div[2]/div[1]/div[5]/div[1]/[1]",
|
||||
"End": "---End date\n---/html/body/div[6]/div[3]/div/aside/div/div[2]/div[1]/div[5]/div[1]/[2]",
|
||||
"Funded under": "/html/body/div[6]/div[3]/div/aside/div/div[2]/div[2]/div[1]/ul/li",
|
||||
"Total cost": "---Total cost\n---/html/body/div[6]/div[3]/div/aside/div/div[2]/div[2]/div[2]/div/div[1]/div[1]",
|
||||
"EU contribution": "---EU contribution\n---/html/body/div[6]/div[3]/div/aside/div/div[2]/div[2]/div[2]/div/div[1]/div[2]",
|
||||
"coordinated by": "---\nSpain---/html/body/div[6]/div[3]/div/aside/div/div[2]/div[2]/div[3]/p",
|
||||
"Long Title": "/html/body/div[6]/section/div/div/div/h1",
|
||||
"Description Title": "/html/body/div[6]/div[3]/div/article/div[1]/h3",
|
||||
"Description": "/html/body/div[6]/div[3]/div/article/div[1]/p",
|
||||
"Description 2": "/html/body/div[6]/div[3]/div/article/div[1]/p",
|
||||
"Keywords": ".../html/body/div[6]/div[3]/div/article/div[4]/ul/li[...]/a",
|
||||
"with_second_option": "0"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
1706512872241 geckodriver INFO Listening on 127.0.0.1:61927
|
||||
1706512875289 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "61928" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileZ4GYbk"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706512875604 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706512875720 Marionette INFO Listening on port 61936
|
||||
WebDriver BiDi listening on ws://127.0.0.1:61928
|
||||
Read port: 61936
|
||||
1706512875902 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:61928/devtools/browser/8abee755-f999-4464-a910-0b12ce76dcac
|
||||
1706512878716 Marionette INFO Stopped listening on port 61936
|
||||
Dynamically enable window occlusion 1
|
||||
1706512913616 geckodriver INFO Listening on 127.0.0.1:61977
|
||||
1706512916683 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "61978" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilea6Nuly"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706512916963 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706512917066 Marionette INFO Listening on port 61986
|
||||
WebDriver BiDi listening on ws://127.0.0.1:61978
|
||||
Read port: 61986
|
||||
1706512917225 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:61978/devtools/browser/23f52935-e3e8-45b5-9491-e3d9b7fa3a12
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706512948230 addons.xpi ERROR System addon update list error SyntaxError: XMLHttpRequest.open: 'http://%(server)s/dummy-system-addons.xml' is not a valid URL.
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706512963801 Marionette INFO Stopped listening on port 61986
|
||||
Dynamically enable window occlusion 1
|
||||
1706513434362 geckodriver INFO Listening on 127.0.0.1:62299
|
||||
1706513437373 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "62300" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileU5KjQV"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706513437671 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706513437876 Marionette INFO Listening on port 62308
|
||||
WebDriver BiDi listening on ws://127.0.0.1:62300
|
||||
Read port: 62308
|
||||
1706513438049 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:62300/devtools/browser/48bd1cd4-f629-4c4d-9a30-3ffdb64a85a1
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706513455836 Marionette INFO Stopped listening on port 62308
|
||||
Dynamically enable window occlusion 1
|
||||
1706513740301 geckodriver INFO Listening on 127.0.0.1:62515
|
||||
1706513743332 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "62516" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileCZsE6Z"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706513743614 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706513743718 Marionette INFO Listening on port 62525
|
||||
WebDriver BiDi listening on ws://127.0.0.1:62516
|
||||
Read port: 62525
|
||||
1706513743877 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:62516/devtools/browser/95994dc7-0375-48e6-91b4-7d6279562c9b
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706513762893 Marionette INFO Stopped listening on port 62525
|
||||
Dynamically enable window occlusion 1
|
||||
1706514277598 geckodriver INFO Listening on 127.0.0.1:62813
|
||||
1706514280641 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "62814" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileoxA04s"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706514280922 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706514281026 Marionette INFO Listening on port 62823
|
||||
WebDriver BiDi listening on ws://127.0.0.1:62814
|
||||
Read port: 62823
|
||||
1706514281186 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:62814/devtools/browser/01199af5-22cf-41b7-bcd3-97d0897ae6aa
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706514300327 Marionette INFO Stopped listening on port 62823
|
||||
Dynamically enable window occlusion 1
|
||||
1706514922174 geckodriver INFO Listening on 127.0.0.1:63252
|
||||
1706514925215 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "632 ... 3" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilelVlH90"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706514925495 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706514925555 Marionette INFO Listening on port 63262
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63253
|
||||
Read port: 63262
|
||||
1706514925709 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63253/devtools/browser/d3da3617-71da-44de-b975-e8eea482dc70
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706514938955 Marionette INFO Stopped listening on port 63262
|
||||
Dynamically enable window occlusion 1
|
||||
1706515338529 geckodriver INFO Listening on 127.0.0.1:63526
|
||||
1706515341570 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "635 ... 7" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileDi4qHi"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706515341847 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706515341907 Marionette INFO Listening on port 63537
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63527
|
||||
Read port: 63537
|
||||
1706515342062 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63527/devtools/browser/92e1cfaf-7409-43d8-b126-50545f1fbf92
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706515363367 Marionette INFO Stopped listening on port 63537
|
||||
Dynamically enable window occlusion 1
|
||||
1706516149647 geckodriver INFO Listening on 127.0.0.1:63943
|
||||
1706516152684 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "639 ... 4" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileazI0M0"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706516152984 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706516153052 Marionette INFO Listening on port 63952
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63944
|
||||
Read port: 63952
|
||||
1706516153219 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63944/devtools/browser/d55fa28a-9c0e-4279-a98a-f0ccaa3e3050
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706516168425 Marionette INFO Stopped listening on port 63952
|
||||
Dynamically enable window occlusion 1
|
||||
1706518095157 geckodriver INFO Listening on 127.0.0.1:64915
|
||||
1706518098180 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "649 ... 6" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilekaMdvh"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706518098458 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706518098517 Marionette INFO Listening on port 64924
|
||||
Read port: 64924
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64916
|
||||
1706518098569 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:64916/devtools/browser/ace986c4-fd65-4286-a2ae-48363fc44cdc
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706518128501 addons.xpi ERROR System addon update list error SyntaxError: XMLHttpRequest.open: 'http://%(server)s/dummy-system-addons.xml' is not a valid URL.
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
@@ -0,0 +1,453 @@
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from random import randint
|
||||
import time
|
||||
import json
|
||||
import sys
|
||||
from elasticsearch import Elasticsearch
|
||||
import xmltodict
|
||||
|
||||
es = Elasticsearch({'host':'inse.nes.uni-due.de', 'port': 443, 'path_prefix':'elastic', 'scheme':'https'}, basic_auth=('elastic', 'RLldUaJgbGeoqd3KCX3p'), request_timeout=60, max_retries=5, retry_on_timeout=True)
|
||||
|
||||
index_name = "projects_eu_all"
|
||||
|
||||
def getXML(driver, link):
|
||||
link_xml = link + "?format=xml"
|
||||
driver.get(link_xml)
|
||||
|
||||
time.sleep(randint(10, 20))
|
||||
|
||||
xml = driver.page_source
|
||||
xml = xmltodict.parse(xml)
|
||||
|
||||
data = {}
|
||||
data["source"] = "EU"
|
||||
data["link"] = link
|
||||
|
||||
data["id"] = xml.get('project').get('id')
|
||||
data["acronym"] = xml.get('project').get('acronym')
|
||||
data["teaser"] = xml.get('project').get('teaser')
|
||||
data["objective"] = xml.get('project').get('objective')
|
||||
data["title"] = xml.get('project').get('title')
|
||||
data["totalCost"] = xml.get('project').get('totalCost')
|
||||
data["ecMaxContribution"] = xml.get('project').get('ecMaxContribution')
|
||||
data["startDate"] = xml.get('project').get('startDate')
|
||||
data["endDate"] = xml.get('project').get('endDate')
|
||||
|
||||
try:
|
||||
data["funding_start"] = data["startDate"][:4]
|
||||
data["funding_end"] = data["endDate"][:4]
|
||||
except:
|
||||
pass
|
||||
|
||||
data["status"] = xml.get('project').get('status')
|
||||
data["keywords"] = xml.get('project').get('keywords')
|
||||
keywords_nested = []
|
||||
if data["keywords"] is not None:
|
||||
words = data["keywords"].split(', ')
|
||||
for word in words:
|
||||
keywords_nested.append( {"keyword": word} )
|
||||
data["keywords_nested"] = keywords_nested
|
||||
try:
|
||||
data["doi"] = xml.get('project').get('identifiers').get('grantDoi')
|
||||
except:
|
||||
pass
|
||||
|
||||
relations = xml.get('project').get('relations')
|
||||
if relations is not None:
|
||||
associations = relations.get('associations')
|
||||
if associations is not None:
|
||||
programme = associations.get('programme')
|
||||
if programme is not None:
|
||||
programme_nested = []
|
||||
if type(programme) == list:
|
||||
for p in programme:
|
||||
programme_nested.append( {"programme": p.get('title'), "id": p.get('id'), "code": p.get('code')} )
|
||||
else:
|
||||
programme_nested.append( {"programme": programme.get('title'), "id": programme.get('id'), "code": programme.get('code')} )
|
||||
data["programme_nested"] = programme_nested
|
||||
|
||||
organization = associations.get('organization')
|
||||
if organization is not None:
|
||||
organization_nested = []
|
||||
if type(organization) == list:
|
||||
for o in organization:
|
||||
organization_nested.append( {"id": o.get('id'), "name": o.get('legalName'), "type": o.get('@type'), "ecContribution": o.get('@ecContribution'), "netEcContribution": o.get('@netEcContribution'), "totalCost": o.get('@totalCost')} )
|
||||
else:
|
||||
organization_nested.append( {"id": organization.get('id'), "name": organization.get('legalName'), "type": organization.get('@type'), "ecContribution": organization.get('@ecContribution'), "netEcContribution": organization.get('@netEcContribution'), "totalCost": organization.get('@totalCost')} )
|
||||
data["organization_nested"] = organization_nested
|
||||
|
||||
upload_data(data)
|
||||
|
||||
def check_elastic_online():
|
||||
if not es.ping():
|
||||
sys.exit("No connection to Elasticsearch")
|
||||
|
||||
def check_elastic_index():
|
||||
if not es.indices.exists(index=index_name):
|
||||
settings = {
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"searchabilityAnalyzer": {
|
||||
"type": "custom",
|
||||
"tokenizer": "standard",
|
||||
"filter": [
|
||||
"lowercase",
|
||||
"asciifolding"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mappings = {
|
||||
"properties": {
|
||||
"source": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"link": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"acronym": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"teaser": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"title": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"totalCost": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"ecMaxContribution": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"startDate": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"endDate": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"funding_start": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"funding_end": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"doc_number": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"keywords": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"doi": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"keywords_nested": {
|
||||
"type": "nested",
|
||||
"properties": {
|
||||
"keyword": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"programme_nested": {
|
||||
"type": "nested",
|
||||
"properties": {
|
||||
"programme": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"code": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"organization_nested": {
|
||||
"type": "nested",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"ecContribution": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"netEcContribution": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"totalCost": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
es.indices.create(index=index_name, mappings=mappings, settings=settings)
|
||||
|
||||
def upload_data(data):
|
||||
print("Uploading")
|
||||
|
||||
try:
|
||||
id = data["id"]
|
||||
es.index(index=index_name, id=id, document=data)
|
||||
except Exception as e:
|
||||
print("Error while uploading data")
|
||||
print(e)
|
||||
|
||||
# main - entry point
|
||||
if __name__ == '__main__':
|
||||
print("Starting")
|
||||
|
||||
check_elastic_online()
|
||||
check_elastic_index()
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
sys.exit("No path given. Give path to links.json")
|
||||
|
||||
with open(sys.argv[1], "r", encoding='utf-8') as json_links_file:
|
||||
json_links = json.load(json_links_file)
|
||||
|
||||
options = Options()
|
||||
options.add_argument("--headless")
|
||||
|
||||
driver = webdriver.Firefox(options=options)
|
||||
|
||||
print("Getting data.")
|
||||
|
||||
for hit in json_links:
|
||||
link = hit["EU"]
|
||||
|
||||
print(f"{link}")
|
||||
|
||||
try:
|
||||
getXML(driver, link)
|
||||
except:
|
||||
print("Error!")
|
||||
continue
|
||||
|
||||
driver.close()
|
||||
|
||||
print("Finished")
|
||||
@@ -0,0 +1,153 @@
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.common.exceptions import WebDriverException
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from selenium.webdriver.support.ui import Select
|
||||
from random import randint
|
||||
import time
|
||||
import json
|
||||
import sys
|
||||
|
||||
def crawl_links(side, data):
|
||||
options = Options()
|
||||
options.add_argument("--headless")
|
||||
|
||||
driver = webdriver.Firefox(options=options)
|
||||
|
||||
links = []
|
||||
|
||||
driver.get(side["start-url"])
|
||||
|
||||
# always wait so everything can be loaded
|
||||
time.sleep(10)
|
||||
|
||||
if side["long_waits"] == "True":
|
||||
|
||||
breakup_counter = 0
|
||||
while True:
|
||||
try:
|
||||
path = side["link_1"] + str(1) + side["link_2"]
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
breakup_counter = breakup_counter + 1
|
||||
if breakup_counter == 150:
|
||||
raise Exception
|
||||
time.sleep(3)
|
||||
|
||||
|
||||
if side["cookies"] == "True":
|
||||
try:
|
||||
driver.find_element(By.XPATH, side["cookies_button"].replace("'", '"')).click()
|
||||
|
||||
time.sleep(3)
|
||||
except NoSuchElementException as nsee:
|
||||
pass
|
||||
|
||||
if side["search"] == "True":
|
||||
field = driver.find_element(By.XPATH, side["field"].replace("'", '"'))
|
||||
field.clear()
|
||||
field.send_keys(side["string"])
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
driver.find_element(By.XPATH, side["button"]).click()
|
||||
|
||||
time.sleep(5)
|
||||
|
||||
selector_counter = 1
|
||||
|
||||
while True:
|
||||
try:
|
||||
counter = 1
|
||||
|
||||
while counter <= int(side["link_max"]):
|
||||
path = side["link_1"] + str(counter) + side["link_2"]
|
||||
counter += 1
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
links.append(link)
|
||||
|
||||
except NoSuchElementException as nsee:
|
||||
break
|
||||
|
||||
time.sleep(randint(1, 5))
|
||||
|
||||
if side["page_button"] == "True":
|
||||
try:
|
||||
driver.find_element(By.XPATH, side["next_page"]).click()
|
||||
|
||||
if side["long_waits"] == "False":
|
||||
time.sleep(randint(1, 5))
|
||||
else:
|
||||
breakup_counter = 0
|
||||
while True:
|
||||
try:
|
||||
path = side["link_1"] + str(1) + side["link_2"]
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
breakup_counter = breakup_counter + 1
|
||||
if breakup_counter == 150:
|
||||
raise Exception
|
||||
time.sleep(3)
|
||||
|
||||
except WebDriverException as wde:
|
||||
break
|
||||
|
||||
if side["page_selector"] == "True":
|
||||
selector = driver.find_element(By.XPATH, side["selector"].replace("'", '"'))
|
||||
all_options = selector.find_elements(By.TAG_NAME, "option")
|
||||
|
||||
if selector_counter == len(all_options):
|
||||
break
|
||||
|
||||
next_value = all_options[selector_counter].get_attribute("value")
|
||||
selector_counter += 1
|
||||
|
||||
|
||||
Select(selector).select_by_value(next_value)
|
||||
|
||||
time.sleep(randint(1, 5))
|
||||
|
||||
# close driver
|
||||
driver.close()
|
||||
|
||||
print(len(links))
|
||||
add_data(links, side["name"], data)
|
||||
|
||||
def add_data(links, name, data):
|
||||
for link in links:
|
||||
data.append({f"{name}": link})
|
||||
|
||||
def write_data(data):
|
||||
print(len(data))
|
||||
with open("links.json", "w") as f:
|
||||
json.dump(data, f)
|
||||
|
||||
# main - entry point
|
||||
if __name__ == '__main__':
|
||||
print("Starting")
|
||||
|
||||
data = []
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
sys.exit("No path given. Give path to links_config.json")
|
||||
|
||||
with open(sys.argv[1], "r", encoding='utf-8') as json_file:
|
||||
json_loaded = json.load(json_file)
|
||||
|
||||
for side in json_loaded:
|
||||
name = side["name"]
|
||||
print(f"Getting links from {name}.")
|
||||
try:
|
||||
crawl_links(side, data)
|
||||
except:
|
||||
print(f"Error while getting {name}-links. Check links_config.json!")
|
||||
|
||||
print("Writing links.")
|
||||
write_data(data)
|
||||
|
||||
print("Finished")
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"name": "EU",
|
||||
"start-url": "https://cordis.europa.eu/search?q=contenttype%3D%27project%27&p=1&num=10&srt=Relevance:decreasing",
|
||||
"cookies": "True",
|
||||
"cookies_button": "/html/body/app-root/app-cookies-consent/div/div/div/button[2]",
|
||||
"search": "False",
|
||||
"page_button": "True",
|
||||
"next_page": "/html/body/app-root/div[2]/ng-component/div[3]/app-cordis-search-results/div/section[2]/app-pagination/div/nav/ul[3]/li[1]/a",
|
||||
"page_selector": "False",
|
||||
"link_max": "50",
|
||||
"link_1": "/html/body/app-root/div[2]/ng-component/div[3]/app-cordis-search-results/div/section[1]/app-card-search[",
|
||||
"link_2": "]/div/div[2]/a",
|
||||
"long_waits": "True"
|
||||
}
|
||||
]
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"BMBF": {
|
||||
"Förderkennzeichen": "/html/body/div[1]/div/div/div[1]/div[+++2+++]/div[2]",
|
||||
"Thema": "/html/body/div[1]/div/div/div[1]/div[+++4+++]/div[2]",
|
||||
"Ressort": "/html/body/div[1]/div/div/div[1]/div[+++6+++]/div[2]",
|
||||
"Laufzeit": "/html/body/div[1]/div/div/div[1]/div[+++8+++]/div[2]",
|
||||
"Förderart": "/html/body/div[1]/div/div/div[1]/div[+++10+++]/div[2]",
|
||||
"Zuwendungsempfänger": "/html/body/div[1]/div/div/div[1]/div[+++12+++]/div[2]",
|
||||
"Verbund": "/html/body/div[1]/div/div/div[1]/div[+++3+++]/div[2]",
|
||||
"Fördersumme": "/html/body/div[1]/div/div/div[1]/div[+++5+++]/div[2]",
|
||||
"Projektträger": "/html/body/div[1]/div/div/div[1]/div[+++7+++]/div[2]",
|
||||
"Leistungsplansystematik": "/html/body/div[1]/div/div/div[1]/div[+++9+++]/div[2]",
|
||||
"Förderprofil": "/html/body/div[1]/div/div/div[1]/div[+++11+++]/div[2]",
|
||||
"Ausführende Stelle": "/html/body/div[1]/div/div/div[1]/div[+++13+++]/div[2]",
|
||||
"with_second_option": "1"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+208
@@ -0,0 +1,208 @@
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from random import randint
|
||||
import time
|
||||
import json
|
||||
import sys
|
||||
from elasticsearch import Elasticsearch
|
||||
|
||||
es = Elasticsearch({'host':'inse.nes.uni-due.de', 'port': 443, 'path_prefix':'elastic', 'scheme':'https'}, basic_auth=('elastic', 'RLldUaJgbGeoqd3KCX3p'), request_timeout=60, max_retries=5, retry_on_timeout=True)
|
||||
|
||||
def crawl_data(key, link, config, driver):
|
||||
driver.get(link)
|
||||
|
||||
time.sleep(randint(10, 20))
|
||||
|
||||
keys = list(config)
|
||||
|
||||
data = {}
|
||||
data["source"] = key
|
||||
data["link"] = link
|
||||
|
||||
is_second_option = False
|
||||
infinity_counter = 0
|
||||
while True:
|
||||
path = config[keys[0]]
|
||||
try:
|
||||
path_1 = path
|
||||
while "+++" in path_1:
|
||||
path_1 = path_1.replace("+++", "")
|
||||
|
||||
driver.find_element(By.XPATH, path_1).text
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
if config["with_second_option"] == "1":
|
||||
try:
|
||||
path_2 = path[:path.find("+++")] + str(int(path[path.find("+++") + 3:path.rfind("+++")]) + 1) + path[path.rfind("+++") + 3:]
|
||||
|
||||
driver.find_element(By.XPATH, path_2).text
|
||||
is_second_option = True
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
time.sleep(3)
|
||||
infinity_counter += 1
|
||||
if infinity_counter >= 100:
|
||||
print("here")
|
||||
raise Exception
|
||||
else:
|
||||
time.sleep(3)
|
||||
infinity_counter += 1
|
||||
if infinity_counter >= 100:
|
||||
print("here")
|
||||
raise Exception
|
||||
|
||||
for k in keys:
|
||||
try:
|
||||
if k == "with_second_option":
|
||||
continue
|
||||
path = config[k]
|
||||
if is_second_option:
|
||||
path = path[:path.find("+++")] + str(int(path[path.find("+++") + 3:path.rfind("+++")]) + 1) + path[path.rfind("+++") + 3:]
|
||||
while "+++" in path:
|
||||
path = path.replace("+++", "")
|
||||
sub = ""
|
||||
if path.startswith("---"):
|
||||
path = path[3:]
|
||||
sub = path[0:path.find("---")]
|
||||
path = path[path.find("---") + 3:]
|
||||
if path.startswith("..."):
|
||||
path = path[3:]
|
||||
li_counter = 1
|
||||
lis = []
|
||||
while True:
|
||||
elem = ""
|
||||
try:
|
||||
elem = driver.find_element(By.XPATH, path.replace("...", str(li_counter))).text
|
||||
li_counter += 1
|
||||
lis.append(elem)
|
||||
except NoSuchElementException as nsee:
|
||||
break
|
||||
data[k] = lis
|
||||
continue
|
||||
|
||||
elem = ""
|
||||
try:
|
||||
elem = driver.find_element(By.XPATH, path).text
|
||||
except:
|
||||
continue
|
||||
if sub != "":
|
||||
elem = elem.replace(sub, "")
|
||||
data[k] = elem
|
||||
except:
|
||||
continue
|
||||
|
||||
upload_data(key, data)
|
||||
|
||||
def check_elastic_online():
|
||||
if not es.ping():
|
||||
sys.exit("No connection to Elasticsearch")
|
||||
|
||||
def check_elastic_index(data, index_name):
|
||||
if not es.indices.exists(index=index_name):
|
||||
settings = {
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"searchabilityAnalyzer": {
|
||||
"type": "custom",
|
||||
"tokenizer": "standard",
|
||||
"filter": [
|
||||
"lowercase",
|
||||
"asciifolding"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mappings = {}
|
||||
properties = {}
|
||||
|
||||
for key in list(data.keys()):
|
||||
properties[key] = {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 256
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mappings["properties"] = properties
|
||||
|
||||
es.indices.create(index=index_name, mappings=mappings, settings=settings)
|
||||
|
||||
def upload_data(key, data):
|
||||
print("Uploading")
|
||||
index_name = "projects_" + key + "ude"
|
||||
index_name = index_name.lower()
|
||||
|
||||
# add funding_start and funding_end year if possible
|
||||
if key == "BMBF":
|
||||
if data["Laufzeit"] is not None:
|
||||
if data["Laufzeit"] != "":
|
||||
if len(data["Laufzeit"]) > 8:
|
||||
data["funding_start"] = data["Laufzeit"][6:10]
|
||||
data["funding_end"] = data["Laufzeit"][-4:]
|
||||
|
||||
try:
|
||||
check_elastic_index(data, index_name)
|
||||
except Exception as e:
|
||||
print("Error while creating index")
|
||||
print(e)
|
||||
|
||||
try:
|
||||
id = data["link"].replace("/", "")
|
||||
es.index(index=index_name, id=id, document=data)
|
||||
except Exception as e:
|
||||
print("Error while uploading data")
|
||||
print(e)
|
||||
|
||||
# main - entry point
|
||||
if __name__ == '__main__':
|
||||
print("Starting")
|
||||
|
||||
check_elastic_online()
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
sys.exit("No path given. Give path to data_config.json (first) and links.json (second)")
|
||||
|
||||
with open(sys.argv[1], "r", encoding='utf-8') as json_config_file:
|
||||
json_config = json.load(json_config_file)
|
||||
|
||||
with open(sys.argv[2], "r", encoding='utf-8') as json_links_file:
|
||||
json_links = json.load(json_links_file)
|
||||
|
||||
options = Options()
|
||||
options.add_argument("--headless")
|
||||
|
||||
driver = webdriver.Firefox(options=options)
|
||||
|
||||
print("Getting data.")
|
||||
|
||||
for hit in json_links:
|
||||
key = list(hit)[0]
|
||||
|
||||
link = hit[key]
|
||||
|
||||
config = {}
|
||||
try:
|
||||
config = json_config[key]
|
||||
except KeyError:
|
||||
print(f"No Config for {key}")
|
||||
continue
|
||||
|
||||
print(f"{key} - {link}")
|
||||
|
||||
try:
|
||||
crawl_data(key, link, config, driver)
|
||||
except:
|
||||
print("Error!")
|
||||
continue
|
||||
|
||||
driver.close()
|
||||
|
||||
print("Finished")
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.common.exceptions import WebDriverException
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from selenium.webdriver.support.ui import Select
|
||||
from random import randint
|
||||
import time
|
||||
import json
|
||||
import sys
|
||||
|
||||
def crawl_links(side, data):
|
||||
options = Options()
|
||||
options.add_argument("--headless")
|
||||
|
||||
driver = webdriver.Firefox(options=options)
|
||||
|
||||
links = []
|
||||
|
||||
driver.get(side["start-url"])
|
||||
|
||||
# always wait so everything can be loaded
|
||||
time.sleep(10)
|
||||
|
||||
if side["long_waits"] == "True":
|
||||
|
||||
breakup_counter = 0
|
||||
while True:
|
||||
try:
|
||||
path = side["link_1"] + str(1) + side["link_2"]
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
breakup_counter = breakup_counter + 1
|
||||
if breakup_counter == 150:
|
||||
raise Exception
|
||||
time.sleep(3)
|
||||
|
||||
|
||||
if side["cookies"] == "True":
|
||||
try:
|
||||
driver.find_element(By.XPATH, side["cookies_button"].replace("'", '"')).click()
|
||||
|
||||
time.sleep(3)
|
||||
except NoSuchElementException as nsee:
|
||||
pass
|
||||
|
||||
if side["search"] == "True":
|
||||
field = driver.find_element(By.XPATH, side["field"].replace("'", '"'))
|
||||
field.clear()
|
||||
field.send_keys(side["string"])
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
driver.find_element(By.XPATH, side["button"]).click()
|
||||
|
||||
time.sleep(5)
|
||||
|
||||
selector_counter = 1
|
||||
|
||||
while True:
|
||||
try:
|
||||
counter = 1
|
||||
|
||||
while counter <= int(side["link_max"]):
|
||||
path = side["link_1"] + str(counter) + side["link_2"]
|
||||
counter += 1
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
links.append(link)
|
||||
|
||||
except NoSuchElementException as nsee:
|
||||
break
|
||||
|
||||
time.sleep(randint(1, 5))
|
||||
|
||||
if side["page_button"] == "True":
|
||||
try:
|
||||
driver.find_element(By.XPATH, side["next_page"]).click()
|
||||
|
||||
if side["long_waits"] == "False":
|
||||
time.sleep(randint(1, 5))
|
||||
else:
|
||||
breakup_counter = 0
|
||||
while True:
|
||||
try:
|
||||
path = side["link_1"] + str(1) + side["link_2"]
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
breakup_counter = breakup_counter + 1
|
||||
if breakup_counter == 150:
|
||||
raise Exception
|
||||
time.sleep(3)
|
||||
|
||||
except WebDriverException as wde:
|
||||
break
|
||||
|
||||
if side["page_selector"] == "True":
|
||||
selector = driver.find_element(By.XPATH, side["selector"].replace("'", '"'))
|
||||
all_options = selector.find_elements(By.TAG_NAME, "option")
|
||||
|
||||
if selector_counter == len(all_options):
|
||||
break
|
||||
|
||||
next_value = all_options[selector_counter].get_attribute("value")
|
||||
selector_counter += 1
|
||||
|
||||
|
||||
Select(selector).select_by_value(next_value)
|
||||
|
||||
time.sleep(randint(1, 5))
|
||||
|
||||
# close driver
|
||||
driver.close()
|
||||
|
||||
print(len(links))
|
||||
add_data(links, side["name"], data)
|
||||
|
||||
def add_data(links, name, data):
|
||||
for link in links:
|
||||
data.append({f"{name}": link})
|
||||
|
||||
def write_data(data):
|
||||
print(len(data))
|
||||
with open("links.json", "w") as f:
|
||||
json.dump(data, f)
|
||||
|
||||
# main - entry point
|
||||
if __name__ == '__main__':
|
||||
print("Starting")
|
||||
|
||||
data = []
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
sys.exit("No path given. Give path to links_config.json")
|
||||
|
||||
with open(sys.argv[1], "r", encoding='utf-8') as json_file:
|
||||
json_loaded = json.load(json_file)
|
||||
|
||||
for side in json_loaded:
|
||||
name = side["name"]
|
||||
print(f"Getting links from {name}.")
|
||||
try:
|
||||
crawl_links(side, data)
|
||||
except:
|
||||
print(f"Error while getting {name}-links. Check links_config.json!")
|
||||
|
||||
print("Writing links.")
|
||||
write_data(data)
|
||||
|
||||
print("Finished")
|
||||
File diff suppressed because one or more lines are too long
+18
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"name": "BMBF",
|
||||
"start-url": "https://foerderportal.bund.de/foekat/jsp/SucheAction.do?actionMode=searchmask",
|
||||
"cookies": "False",
|
||||
"search": "True",
|
||||
"field": "//*[@id='suche_schnellSuche']",
|
||||
"string": "Universität Duisburg-Essen",
|
||||
"button": "/html/body/div[1]/div/div/form[1]/div/fieldset/table/tbody/tr[1]/td[2]/input",
|
||||
"page_button": "False",
|
||||
"page_selector": "True",
|
||||
"selector": "//*[@id='listselect_suche_listrowfrom']",
|
||||
"link_max": "10",
|
||||
"link_1": "/html/body/div[1]/div/div/div[2]/table/tbody/tr[",
|
||||
"link_2": "]/td[1]/a[1]",
|
||||
"long_waits": "False"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,368 @@
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.common.exceptions import WebDriverException
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from random import randint
|
||||
import time
|
||||
import sys
|
||||
from elasticsearch import Elasticsearch
|
||||
|
||||
es = Elasticsearch({'host':'inse.nes.uni-due.de', 'port': 443, 'path_prefix':'elastic', 'scheme':'https'}, basic_auth=('elastic', 'RLldUaJgbGeoqd3KCX3p'), request_timeout=60, max_retries=5, retry_on_timeout=True)
|
||||
|
||||
def does_elem_exist(driver, xpath):
|
||||
try:
|
||||
driver.find_element(By.XPATH, xpath)
|
||||
except NoSuchElementException:
|
||||
return False
|
||||
return True
|
||||
|
||||
def first_level(driver):
|
||||
print("Starting first level.")
|
||||
project_links = []
|
||||
|
||||
driver.get("https://gepris.dfg.de/gepris/institution/972220")
|
||||
|
||||
time.sleep(randint(10,15))
|
||||
|
||||
infinity_counter = 0
|
||||
while True:
|
||||
try:
|
||||
driver.find_element(By.XPATH, "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/h1")
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
infinity_counter += 1
|
||||
time.sleep(3)
|
||||
if infinity_counter >= 100:
|
||||
driver.get("https://gepris.dfg.de/gepris/institution/972220")
|
||||
infinity_counter = 0
|
||||
|
||||
# cookies
|
||||
try:
|
||||
driver.find_element(By.XPATH, '//*[@id="c-s-bn"]').click()
|
||||
time.sleep(randint(1,3))
|
||||
except:
|
||||
pass
|
||||
|
||||
# extend all elements
|
||||
elems = driver.find_elements(By.XPATH, 'html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]//ins[@class="jstree-icon"]')
|
||||
for e in elems:
|
||||
try:
|
||||
e.click()
|
||||
except:
|
||||
continue
|
||||
|
||||
# projects
|
||||
projects_outer_counter = 1
|
||||
xpath_outer = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[3]/div[1]/ul/li[" + str(projects_outer_counter) + "]"
|
||||
while does_elem_exist(driver, xpath_outer):
|
||||
path_outer = ["Universität Duisburg-Essen"]
|
||||
elem = driver.find_element(By.XPATH, xpath_outer + "/a").text
|
||||
path_outer.append(elem)
|
||||
|
||||
projects_inner_counter = 1
|
||||
xpath_inner = xpath_outer + "/ul/li[" + str(projects_inner_counter) + "]"
|
||||
while does_elem_exist(driver, xpath_inner):
|
||||
path_inner = path_outer.copy()
|
||||
elem = driver.find_element(By.XPATH, xpath_inner + "/a").text
|
||||
path_inner.append(elem)
|
||||
|
||||
projects_link_counter = 1
|
||||
xpath_link = xpath_inner + "/ul/li[" + str(projects_link_counter) + "]"
|
||||
while does_elem_exist(driver, xpath_link):
|
||||
elem = driver.find_element(By.XPATH, xpath_link + "/div/div/a").get_attribute('href')
|
||||
project_links.append({"link": elem, "path": path_inner})
|
||||
|
||||
projects_link_counter += 1
|
||||
xpath_link = xpath_inner + "/ul/li[" + str(projects_link_counter) + "]"
|
||||
|
||||
projects_inner_counter += 1
|
||||
xpath_inner = xpath_outer + "/ul/li[" + str(projects_inner_counter) + "]"
|
||||
|
||||
projects_outer_counter += 1
|
||||
xpath_outer = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[3]/div[1]/ul/li[" + str(projects_outer_counter) + "]"
|
||||
|
||||
# lower institutions
|
||||
for_second_level = []
|
||||
base_path = ["Universität Duisburg-Essen"]
|
||||
base_xpath = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[5]/div[1]"
|
||||
get_path_links(driver, base_path, base_xpath, for_second_level)
|
||||
|
||||
return project_links, for_second_level
|
||||
|
||||
def get_path_links(driver, base_path, base_xpath, for_second_level):
|
||||
counter = 1
|
||||
xpath = base_xpath + "/ul/li[" + str(counter) + "]"
|
||||
while does_elem_exist(driver, xpath):
|
||||
path = base_path.copy()
|
||||
elem = driver.find_element(By.XPATH, xpath + "/a").text.replace("\n", " ")
|
||||
path.append(elem)
|
||||
|
||||
link = driver.find_element(By.XPATH, xpath + "/a").get_attribute('href')
|
||||
|
||||
for_second_level.append({"link": link, "path": path})
|
||||
|
||||
get_path_links(driver, path, xpath, for_second_level)
|
||||
|
||||
counter += 1
|
||||
xpath = base_xpath + "/ul/li[" + str(counter) + "]"
|
||||
|
||||
def second_level(driver, project_links, for_second_level):
|
||||
print("Starting second level.")
|
||||
|
||||
hit_counter = 0
|
||||
for hit in for_second_level:
|
||||
print(hit_counter)
|
||||
hit_counter += 1
|
||||
|
||||
driver.get(hit["link"])
|
||||
path = hit["path"]
|
||||
|
||||
time.sleep(randint(10,15))
|
||||
|
||||
infinity_counter = 0
|
||||
while True:
|
||||
try:
|
||||
driver.find_element(By.XPATH, "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/h1")
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
infinity_counter += 1
|
||||
time.sleep(3)
|
||||
if infinity_counter >= 100:
|
||||
driver.get(hit["link"])
|
||||
infinity_counter = 0
|
||||
except WebDriverException as wde:
|
||||
infinity_counter += 1
|
||||
time.sleep(3)
|
||||
if infinity_counter >= 100:
|
||||
driver.get(hit["link"])
|
||||
infinity_counter = 0
|
||||
|
||||
# cookies
|
||||
try:
|
||||
driver.find_element(By.XPATH, '//*[@id="c-s-bn"]').click()
|
||||
time.sleep(randint(1,3))
|
||||
except:
|
||||
pass
|
||||
|
||||
# extend all elements
|
||||
elems = driver.find_elements(By.XPATH, 'html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]//ins[@class="jstree-icon"]')
|
||||
for e in elems:
|
||||
try:
|
||||
e.click()
|
||||
except:
|
||||
continue
|
||||
|
||||
projects_outer_counter = 1
|
||||
xpath_outer = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[3]/div[1]/ul/li[" + str(projects_outer_counter) + "]"
|
||||
while does_elem_exist(driver, xpath_outer):
|
||||
path_outer = path.copy()
|
||||
elem = driver.find_element(By.XPATH, xpath_outer + "/a").text
|
||||
path_outer.append(elem)
|
||||
|
||||
projects_inner_counter = 1
|
||||
xpath_inner = xpath_outer + "/ul/li[" + str(projects_inner_counter) + "]"
|
||||
while does_elem_exist(driver, xpath_inner):
|
||||
path_inner = path_outer.copy()
|
||||
elem = driver.find_element(By.XPATH, xpath_inner + "/a").text
|
||||
path_inner.append(elem)
|
||||
|
||||
projects_link_counter = 1
|
||||
xpath_link = xpath_inner + "/ul/li[" + str(projects_link_counter) + "]"
|
||||
while does_elem_exist(driver, xpath_link):
|
||||
elem = driver.find_element(By.XPATH, xpath_link + "/div/div/a").get_attribute('href')
|
||||
project_links.append({"link": elem, "path": path_inner})
|
||||
|
||||
projects_link_counter += 1
|
||||
xpath_link = xpath_inner + "/ul/li[" + str(projects_link_counter) + "]"
|
||||
|
||||
projects_inner_counter += 1
|
||||
xpath_inner = xpath_outer + "/ul/li[" + str(projects_inner_counter) + "]"
|
||||
|
||||
projects_outer_counter += 1
|
||||
xpath_outer = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[3]/div[1]/ul/li[" + str(projects_outer_counter) + "]"
|
||||
|
||||
return project_links
|
||||
|
||||
def project_level(driver, project_links):
|
||||
print("Starting project level.")
|
||||
|
||||
data_list = []
|
||||
data_names = ["path", "id", "link", "title", "description", "funding_start", "funding_end"]
|
||||
|
||||
hit_counter = 0
|
||||
for hit in project_links:
|
||||
try:
|
||||
print(hit_counter)
|
||||
hit_counter += 1
|
||||
|
||||
driver.get(hit["link"])
|
||||
|
||||
time.sleep(randint(10,15))
|
||||
|
||||
infinity_counter = 0
|
||||
while True:
|
||||
try:
|
||||
driver.find_element(By.XPATH, "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[1]/h1")
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
infinity_counter += 1
|
||||
time.sleep(3)
|
||||
if infinity_counter >= 100:
|
||||
driver.get(hit["link"])
|
||||
infinity_counter = 0
|
||||
except WebDriverException as wde:
|
||||
infinity_counter += 1
|
||||
time.sleep(3)
|
||||
if infinity_counter >= 100:
|
||||
driver.get(hit["link"])
|
||||
infinity_counter = 0
|
||||
|
||||
# cookies
|
||||
try:
|
||||
driver.find_element(By.XPATH, '//*[@id="c-s-bn"]').click()
|
||||
time.sleep(randint(1,3))
|
||||
except:
|
||||
pass
|
||||
|
||||
# extend all elements
|
||||
elems = driver.find_elements(By.XPATH, 'html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]//ins[@class="jstree-icon"]')
|
||||
for e in elems:
|
||||
try:
|
||||
e.click()
|
||||
except:
|
||||
continue
|
||||
|
||||
# get infos
|
||||
data = {}
|
||||
data["path"] = hit["path"]
|
||||
data["link"] = hit["link"]
|
||||
data["id"] = hit["link"][hit["link"].rfind("/") + 1:]
|
||||
|
||||
data["title"] = driver.find_element(By.XPATH, "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[1]/h1").text.replace("\n", " ")
|
||||
data["description"] = driver.find_element(By.XPATH, '//*[@id="projekttext"]').text.replace("\n", " ")
|
||||
|
||||
# upper details
|
||||
elem_counter = 1
|
||||
elem_path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[1]/div[" + str(elem_counter) + "]"
|
||||
while does_elem_exist(driver, elem_path):
|
||||
try:
|
||||
if driver.find_element(By.XPATH, elem_path + "/span[1]").text.replace("\n", " ") not in data_names:
|
||||
data_names.append(driver.find_element(By.XPATH, elem_path + "/span[1]").text.replace("\n", " "))
|
||||
data[driver.find_element(By.XPATH, elem_path + "/span[1]").text.replace("\n", " ")] = driver.find_element(By.XPATH, elem_path + "/span[2]").text.replace("\n", " ")
|
||||
|
||||
elem_counter += 1
|
||||
elem_path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[1]/div[" + str(elem_counter) + "]"
|
||||
except:
|
||||
elem_counter += 1
|
||||
elem_path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[1]/div[" + str(elem_counter) + "]"
|
||||
|
||||
# lower details
|
||||
elem_counter = 2
|
||||
elem_path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[3]/div[1]/div[" + str(elem_counter) + "]"
|
||||
while does_elem_exist(driver, elem_path):
|
||||
try:
|
||||
if driver.find_element(By.XPATH, elem_path + "/span[1]").text.replace("\n", " ") not in data_names:
|
||||
data_names.append(driver.find_element(By.XPATH, elem_path + "/span[1]").text.replace("\n", " "))
|
||||
data[driver.find_element(By.XPATH, elem_path + "/span[1]").text.replace("\n", " ")] = driver.find_element(By.XPATH, elem_path + "/span[2]").text.replace("\n", " ")
|
||||
|
||||
elem_counter += 1
|
||||
elem_path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[3]/div[1]/div[" + str(elem_counter) + "]"
|
||||
except:
|
||||
elem_counter += 1
|
||||
elem_path = "/html/body/div[1]/div/div[3]/div[1]/div/div/div[3]/div[2]/div[3]/div[1]/div[" + str(elem_counter) + "]"
|
||||
|
||||
# get funding_start and funding_end year if possible
|
||||
keysList = list(data.keys())
|
||||
if "Förderung" in keysList:
|
||||
if "seit" in data["Förderung"]:
|
||||
data["funding_start"] = data["Förderung"][-4:]
|
||||
data["funding_end"] = "2999"
|
||||
elif "in" in data["Förderung"]:
|
||||
data["funding_start"] = data["Förderung"][-4:]
|
||||
data["funding_end"] = data["Förderung"][-4:]
|
||||
elif "von" in data["Förderung"]:
|
||||
data["funding_start"] = data["Förderung"][-13:-9]
|
||||
data["funding_end"] = data["Förderung"][-4:]
|
||||
|
||||
data_list.append(data)
|
||||
except:
|
||||
continue
|
||||
|
||||
# upload infos
|
||||
print("Uploading")
|
||||
index_name = "projects_dfg_ude"
|
||||
check_elastic_index(data_names, index_name)
|
||||
|
||||
for data_hit in data_list:
|
||||
try:
|
||||
es.index(index=index_name, id=data_hit["id"], document=data_hit)
|
||||
except Exception as e:
|
||||
print("Error while uploading!")
|
||||
print(e)
|
||||
continue
|
||||
|
||||
def check_elastic_index(data_names, index_name):
|
||||
if not es.indices.exists(index=index_name):
|
||||
settings = {
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"searchabilityAnalyzer": {
|
||||
"type": "custom",
|
||||
"tokenizer": "standard",
|
||||
"filter": [
|
||||
"lowercase",
|
||||
"asciifolding"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mappings = {}
|
||||
properties = {}
|
||||
|
||||
for name in data_names:
|
||||
properties[name] = {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 256
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mappings["properties"] = properties
|
||||
|
||||
es.indices.create(index=index_name, mappings=mappings, settings=settings)
|
||||
|
||||
def check_elastic_online():
|
||||
if not es.ping():
|
||||
sys.exit("No connection to Elasticsearch")
|
||||
|
||||
# main - entry point
|
||||
if __name__ == '__main__':
|
||||
print("Starting")
|
||||
|
||||
check_elastic_online()
|
||||
|
||||
options = Options()
|
||||
options.add_argument("--headless")
|
||||
|
||||
driver = webdriver.Firefox(options=options)
|
||||
|
||||
project_links, for_second_level = first_level(driver)
|
||||
|
||||
print("Number of institutions: " + str(len(for_second_level)))
|
||||
|
||||
project_links = second_level(driver, project_links, for_second_level)
|
||||
|
||||
print("Number of projects: " + str(len(project_links)))
|
||||
|
||||
project_level(driver, project_links)
|
||||
|
||||
driver.close()
|
||||
|
||||
print("Finished")
|
||||
@@ -0,0 +1,365 @@
|
||||
1693491227867 geckodriver INFO Listening on 127.0.0.1:52786
|
||||
1693491230895 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "527 ... 7" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileAPEHB0"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693491231189 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693491231253 Marionette INFO Listening on port 52810
|
||||
WebDriver BiDi listening on ws://127.0.0.1:52787
|
||||
Read port: 52810
|
||||
1693491231438 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:52787/devtools/browser/191dedc7-efdf-4316-ad2e-cd71e25485c6
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
1693497339932 geckodriver INFO Listening on 127.0.0.1:65110
|
||||
1693497342957 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "651 ... 1" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileKj5yCJ"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693497343254 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693497343315 Marionette INFO Listening on port 65119
|
||||
WebDriver BiDi listening on ws://127.0.0.1:65111
|
||||
Read port: 65119
|
||||
1693497344112 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:65111/devtools/browser/3e8a7f8e-6f2d-4e6c-a4f3-fb61f6d68421
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
1:51464
|
||||
1693500403321 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "514 ... 5" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileYybVlP"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693500403655 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693500403714 Marionette INFO Listening on port 51473
|
||||
WebDriver BiDi listening on ws://127.0.0.1:51465
|
||||
Read port: 51473
|
||||
1693500403891 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:51465/devtools/browser/522a69c9-51b2-4cd6-8c14-2e3fe0c4e1ca
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
Error reading incoming packet: (InternalError: too much recursion - JSONPacket.fromHeader@chrome://remote/content/marionette/packets.sys.mjs:136:35
|
||||
Packet.fromHeader@chrome://remote/content/marionette/packets.sys.mjs:80:16
|
||||
_processIncoming@chrome://remote/content/marionette/transport.sys.mjs:406:38
|
||||
onInputStreamReady@chrome://remote/content/marionette/transport.sys.mjs:362:14
|
||||
)
|
||||
1693512395911 geckodriver INFO Listening on 127.0.0.1:62744
|
||||
1693512398933 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "627 ... 5" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileHaAcUE"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693512399233 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693512399301 Marionette INFO Listening on port 62754
|
||||
WebDriver BiDi listening on ws://127.0.0.1:62745
|
||||
Read port: 62754
|
||||
1693512399504 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:62745/devtools/browser/d855dd0a-7032-4e1c-9f2a-2b15b19a1b1b
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
1:63183
|
||||
1693512855885 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "631 ... 4" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileTlEqPA"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693512856186 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693512856246 Marionette INFO Listening on port 63192
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63184
|
||||
Read port: 63192
|
||||
1693512856424 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63184/devtools/browser/f8c0aa57-e6a5-4970-9edd-d36cf1d224ad
|
||||
console.error: ({})
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
console.error: ({})
|
||||
console.error: ({})
|
||||
console.error: ({})
|
||||
console.error: ({})
|
||||
console.error: ({})
|
||||
console.error: ({})
|
||||
console.error: ({})
|
||||
JavaScript error: https://gepris.dfg.de/gepris/js/jquery-1.8.3.js, line 1: SyntaxError: expected expression, got '<'
|
||||
JavaScript error: https://gepris.dfg.de/gepris/js/jquery.jstree.js, line 1: SyntaxError: expected expression, got '<'
|
||||
JavaScript error: https://gepris.dfg.de/gepris/js/send_preferences.js, line 1: SyntaxError: expected expression, got '<'
|
||||
JavaScript error: https://gepris.dfg.de/gepris/js/jquery-ui.js, line 1: SyntaxError: expected expression, got '<'
|
||||
JavaScript error: https://gepris.dfg.de/gepris/js/forms.js, line 1: SyntaxError: expected expression, got '<'
|
||||
console.error: ({})
|
||||
1693561625453 Marionette INFO Stopped listening on port 63192
|
||||
Dynamically enable window occlusion 1
|
||||
1693807892285 geckodriver INFO Listening on 127.0.0.1:63632
|
||||
1693807895342 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "636 ... 3" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilexJ62Tc"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693807895650 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693807895721 Marionette INFO Listening on port 63641
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63633
|
||||
Read port: 63641
|
||||
1693807896098 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63633/devtools/browser/9b4f01df-ae7b-4a18-adbd-ad1be7bec714
|
||||
1693808000756 geckodriver INFO Listening on 127.0.0.1:63742
|
||||
1693808003807 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "637 ... 3" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileGPHGcv"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693808004085 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693808004144 Marionette INFO Listening on port 63751
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63743
|
||||
Read port: 63751
|
||||
1693808004272 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63743/devtools/browser/8f93800c-a263-4b3b-983a-e6606b52529b
|
||||
1693808020143 Marionette INFO Stopped listening on port 63751
|
||||
Dynamically enable window occlusion 1
|
||||
1693808199525 geckodriver INFO Listening on 127.0.0.1:63889
|
||||
1693808202569 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "638 ... 0" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilePs58z9"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693808202856 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693808202916 Marionette INFO Listening on port 63898
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63890
|
||||
Read port: 63898
|
||||
1693808204815 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63890/devtools/browser/5d1a2602-ccb9-430c-ae19-3c8bc97fe2dd
|
||||
1693808221088 Marionette INFO Stopped listening on port 63898
|
||||
Dynamically enable window occlusion 1
|
||||
1693808283774 geckodriver INFO Listening on 127.0.0.1:63975
|
||||
1693808286820 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "639 ... 6" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilefnR710"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693808287099 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693808287158 Marionette INFO Listening on port 63984
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63976
|
||||
Read port: 63984
|
||||
1693808287337 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63976/devtools/browser/6fc4211f-9d72-44ce-aa35-232eb7155c8a
|
||||
1693808302992 Marionette INFO Stopped listening on port 63984
|
||||
Dynamically enable window occlusion 1
|
||||
1693808832976 geckodriver INFO Listening on 127.0.0.1:64236
|
||||
1693808836033 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "642 ... 7" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileMHEcc0"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693808836319 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693808836378 Marionette INFO Listening on port 64246
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64237
|
||||
Read port: 64246
|
||||
1693808836559 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:64237/devtools/browser/414f9f3b-50fe-4b24-bbe1-a3afcbe43642
|
||||
1693808853144 Marionette INFO Stopped listening on port 64246
|
||||
Dynamically enable window occlusion 1
|
||||
1693808903946 geckodriver INFO Listening on 127.0.0.1:64337
|
||||
1693808907008 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "643 ... 8" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileuwZiWw"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693808907300 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693808907359 Marionette INFO Listening on port 64346
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64338
|
||||
Read port: 64346
|
||||
1693808907540 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:64338/devtools/browser/6f5e69d7-6a34-4e71-8bf1-84c939910486
|
||||
1693808995610 geckodriver INFO Listening on 127.0.0.1:64425
|
||||
1693808998654 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "644 ... 6" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileeawRl1"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693808998945 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693808999005 Marionette INFO Listening on port 64434
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64426
|
||||
Read port: 64434
|
||||
1693808999257 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:64426/devtools/browser/9d5ab139-82ed-4c51-8710-4a1a37144e53
|
||||
1693809014002 Marionette INFO Stopped listening on port 64434
|
||||
Dynamically enable window occlusion 1
|
||||
1693809021349 geckodriver INFO Listening on 127.0.0.1:64483
|
||||
1693809024407 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "644 ... 4" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileeVlNoQ"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809024686 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809024746 Marionette INFO Listening on port 64492
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64484
|
||||
Read port: 64492
|
||||
1693809024930 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:64484/devtools/browser/c213fe14-9323-486b-913d-b6845b33bb1f
|
||||
1693809177340 geckodriver INFO Listening on 127.0.0.1:64602
|
||||
1693809180383 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "646 ... 3" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofile4Ud29u"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809180669 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809180731 Marionette INFO Listening on port 64611
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64603
|
||||
Read port: 64611
|
||||
1693809180915 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:64603/devtools/browser/c8c67629-7ad9-403e-be00-c6728c1edc38
|
||||
1693809197701 Marionette INFO Stopped listening on port 64611
|
||||
Dynamically enable window occlusion 1
|
||||
1693809410951 geckodriver INFO Listening on 127.0.0.1:64741
|
||||
1693809413987 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "64742" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileBNJsLr"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809414272 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809414374 Marionette INFO Listening on port 64750
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64742
|
||||
Read port: 64750
|
||||
1693809414563 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:64742/devtools/browser/032949b6-860b-4cc1-8c8a-93a556580056
|
||||
SourceActor threw an exception: Error: Failed to fetch https://gepris.dfg.de/gepris/institution/972220?context=institution&task=showDetail&id=972220&. Code 2152398879.
|
||||
Stack: onResponse@resource://devtools/shared/DevToolsUtils.js:596:16
|
||||
onStopRequest@resource://gre/modules/NetUtil.sys.mjs:124:18
|
||||
Line: 596, column: 16
|
||||
console.error: (new Error("Failed to fetch https://gepris.dfg.de/gepris/institution/972220?context=institution&task=showDetail&id=972220&. Code 2152398879.", "resource://devtools/shared/DevToolsUtils.js", 596))
|
||||
JavaScript error: resource://devtools/shared/DevToolsUtils.js, line 596: Error: Failed to fetch https://gepris.dfg.de/gepris/institution/972220?context=institution&task=showDetail&id=972220&. Code 2152398879.
|
||||
JavaScript error: resource://gre/modules/AsyncShutdown.sys.mjs, line 573: NotFoundError: No such JSWindowActor 'DevToolsFrame'
|
||||
1693809551269 Marionette INFO Stopped listening on port 64750
|
||||
Dynamically enable window occlusion 1
|
||||
1693809553276 geckodriver INFO Listening on 127.0.0.1:64861
|
||||
1693809556322 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "64862" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileYjRp92"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809556604 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809556704 Marionette INFO Listening on port 64870
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64862
|
||||
Read port: 64870
|
||||
1693809556899 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:64862/devtools/browser/ae1a1655-7d46-4f4e-b7c9-8bd09aaf0a7e
|
||||
1693809605833 Marionette INFO Stopped listening on port 64870
|
||||
Dynamically enable window occlusion 1
|
||||
ng command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "64933" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofile9jOgsl"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809606105 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809606205 Marionette INFO Listening on port 64941
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64933
|
||||
Read port: 64941
|
||||
1693809606385 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:64933/devtools/browser/0bf09717-0496-4dd7-988c-9b7a127bf0c8
|
||||
1693809701622 Marionette WARN TimedPromise timed out after 500 ms: stacktrace:
|
||||
TimedPromise/<@chrome://remote/content/marionette/sync.sys.mjs:219:24
|
||||
TimedPromise@chrome://remote/content/marionette/sync.sys.mjs:203:10
|
||||
interaction.flushEventLoop@chrome://remote/content/marionette/interaction.sys.mjs:429:10
|
||||
webdriverClickElement@chrome://remote/content/marionette/interaction.sys.mjs:178:31
|
||||
1693809731258 Marionette INFO Stopped listening on port 64941
|
||||
Dynamically enable window occlusion 1
|
||||
1693809761540 geckodriver INFO Listening on 127.0.0.1:65040
|
||||
1693809764597 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "65041" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileRw8cTX"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809764882 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809764982 Marionette INFO Listening on port 65049
|
||||
WebDriver BiDi listening on ws://127.0.0.1:65041
|
||||
Read port: 65049
|
||||
1693809765165 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:65041/devtools/browser/9ea0b7fe-35e1-4162-9789-e6cdd232e534
|
||||
1693809768622 Marionette INFO Stopped listening on port 65049
|
||||
Dynamically enable window occlusion 1
|
||||
1693809803176 geckodriver INFO Listening on 127.0.0.1:65104
|
||||
1693809806223 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "65105" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileUZdYnY"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693809806507 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693809806607 Marionette INFO Listening on port 65113
|
||||
WebDriver BiDi listening on ws://127.0.0.1:65105
|
||||
Read port: 65113
|
||||
1693809806794 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:65105/devtools/browser/1407ee68-83de-4891-86c2-c777191ddf9c
|
||||
1693810006863 Marionette INFO Stopped listening on port 65113
|
||||
Dynamically enable window occlusion 1
|
||||
1693810347268 geckodriver INFO Listening on 127.0.0.1:65387
|
||||
1693810350323 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "653 ... 8" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofiledt05h4"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693810350604 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693810350664 Marionette INFO Listening on port 65396
|
||||
WebDriver BiDi listening on ws://127.0.0.1:65388
|
||||
Read port: 65396
|
||||
1693810350846 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:65388/devtools/browser/8fb510ec-c007-4366-a073-929c07069cf4
|
||||
1693810419965 geckodriver INFO Listening on 127.0.0.1:65465
|
||||
1693810423008 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "654 ... 6" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilejifryk"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1693810423284 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1693810423343 Marionette INFO Listening on port 65474
|
||||
Read port: 65474
|
||||
WebDriver BiDi listening on ws://127.0.0.1:65466
|
||||
1693810423390 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:65466/devtools/browser/7a22f73a-7490-4df0-8f22-5d7dc08d4f83
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
JavaScript error: resource://gre/modules/PromiseWorker.sys.mjs, line 102: Error: Could not get children of file(C:\Users\voglt\AppData\Local\Temp\rust_mozprofilejifryk\thumbnails) because it does not exist
|
||||
JavaScript error: resource://gre/modules/PromiseWorker.sys.mjs, line 102: Error: Could not get children of file(C:\Users\voglt\AppData\Local\Temp\rust_mozprofilejifryk\thumbnails) because it does not exist
|
||||
JavaScript error: resource://gre/modules/PromiseWorker.sys.mjs, line 102: Error: Could not get children of file(C:\Users\voglt\AppData\Local\Temp\rust_mozprofilejifryk\thumbnails) because it does not exist
|
||||
JavaScript error: resource://gre/modules/PromiseWorker.sys.mjs, line 102: Error: Could not get children of file(C:\Users\voglt\AppData\Local\Temp\rust_mozprofilejifryk\thumbnails) because it does not exist
|
||||
1693856815253 Marionette INFO Stopped listening on port 65474
|
||||
Dynamically enable window occlusion 1
|
||||
1704373764930 geckodriver INFO Listening on 127.0.0.1:58846
|
||||
1704373767967 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "588 ... 7" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilePeC1a5"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1704373768285 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1704373768357 Marionette INFO Listening on port 58855
|
||||
WebDriver BiDi listening on ws://127.0.0.1:58847
|
||||
Read port: 58855
|
||||
1704373768536 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:58847/devtools/browser/dcf26f45-17e3-40d1-b201-eada2dc15dd8
|
||||
1704373798354 addons.xpi ERROR System addon update list error SyntaxError: XMLHttpRequest.open: 'http://%(server)s/dummy-system-addons.xml' is not a valid URL.
|
||||
console.log: "RemoteSettingsWorker error: DataError: IndexedDB: records, timestamps execute() Data provided to an operation does not meet requirements."
|
||||
console.error: (new RemoteSettingsWorkerError("DataError: IndexedDB: records, timestamps execute() Data provided to an operation does not meet requirements.", "resource://services-settings/RemoteSettingsWorker.sys.mjs", 34))
|
||||
JavaScript error: , line 0: NS_ERROR_NOT_AVAILABLE
|
||||
1704420737107 Marionette INFO Stopped listening on port 58855
|
||||
Dynamically enable window occlusion 1
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"EU": {
|
||||
"Title": "/html/body/div[6]/div[3]/div/aside/div/div[2]/div[1]/div[1]",
|
||||
"ID": "/html/body/div[6]/div[3]/div/aside/div/div[2]/div[1]/div[2]",
|
||||
"Start": "---Start date\n---/html/body/div[6]/div[3]/div/aside/div/div[2]/div[1]/div[5]/div[1]/[1]",
|
||||
"End": "---End date\n---/html/body/div[6]/div[3]/div/aside/div/div[2]/div[1]/div[5]/div[1]/[2]",
|
||||
"Funded under": "/html/body/div[6]/div[3]/div/aside/div/div[2]/div[2]/div[1]/ul/li",
|
||||
"Total cost": "---Total cost\n---/html/body/div[6]/div[3]/div/aside/div/div[2]/div[2]/div[2]/div/div[1]/div[1]",
|
||||
"EU contribution": "---EU contribution\n---/html/body/div[6]/div[3]/div/aside/div/div[2]/div[2]/div[2]/div/div[1]/div[2]",
|
||||
"coordinated by": "---\nSpain---/html/body/div[6]/div[3]/div/aside/div/div[2]/div[2]/div[3]/p",
|
||||
"Long Title": "/html/body/div[6]/section/div/div/div/h1",
|
||||
"Description Title": "/html/body/div[6]/div[3]/div/article/div[1]/h3",
|
||||
"Description": "/html/body/div[6]/div[3]/div/article/div[1]/p",
|
||||
"Description 2": "/html/body/div[6]/div[3]/div/article/div[1]/p",
|
||||
"Keywords": ".../html/body/div[6]/div[3]/div/article/div[4]/ul/li[...]/a",
|
||||
"with_second_option": "0"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
1706512872241 geckodriver INFO Listening on 127.0.0.1:61927
|
||||
1706512875289 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "61928" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileZ4GYbk"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706512875604 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706512875720 Marionette INFO Listening on port 61936
|
||||
WebDriver BiDi listening on ws://127.0.0.1:61928
|
||||
Read port: 61936
|
||||
1706512875902 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:61928/devtools/browser/8abee755-f999-4464-a910-0b12ce76dcac
|
||||
1706512878716 Marionette INFO Stopped listening on port 61936
|
||||
Dynamically enable window occlusion 1
|
||||
1706512913616 geckodriver INFO Listening on 127.0.0.1:61977
|
||||
1706512916683 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "61978" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilea6Nuly"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706512916963 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706512917066 Marionette INFO Listening on port 61986
|
||||
WebDriver BiDi listening on ws://127.0.0.1:61978
|
||||
Read port: 61986
|
||||
1706512917225 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:61978/devtools/browser/23f52935-e3e8-45b5-9491-e3d9b7fa3a12
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706512948230 addons.xpi ERROR System addon update list error SyntaxError: XMLHttpRequest.open: 'http://%(server)s/dummy-system-addons.xml' is not a valid URL.
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706512963801 Marionette INFO Stopped listening on port 61986
|
||||
Dynamically enable window occlusion 1
|
||||
1706513434362 geckodriver INFO Listening on 127.0.0.1:62299
|
||||
1706513437373 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "62300" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileU5KjQV"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706513437671 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706513437876 Marionette INFO Listening on port 62308
|
||||
WebDriver BiDi listening on ws://127.0.0.1:62300
|
||||
Read port: 62308
|
||||
1706513438049 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:62300/devtools/browser/48bd1cd4-f629-4c4d-9a30-3ffdb64a85a1
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706513455836 Marionette INFO Stopped listening on port 62308
|
||||
Dynamically enable window occlusion 1
|
||||
1706513740301 geckodriver INFO Listening on 127.0.0.1:62515
|
||||
1706513743332 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "62516" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileCZsE6Z"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706513743614 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706513743718 Marionette INFO Listening on port 62525
|
||||
WebDriver BiDi listening on ws://127.0.0.1:62516
|
||||
Read port: 62525
|
||||
1706513743877 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:62516/devtools/browser/95994dc7-0375-48e6-91b4-7d6279562c9b
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706513762893 Marionette INFO Stopped listening on port 62525
|
||||
Dynamically enable window occlusion 1
|
||||
1706514277598 geckodriver INFO Listening on 127.0.0.1:62813
|
||||
1706514280641 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "62814" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileoxA04s"
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706514280922 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706514281026 Marionette INFO Listening on port 62823
|
||||
WebDriver BiDi listening on ws://127.0.0.1:62814
|
||||
Read port: 62823
|
||||
1706514281186 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
DevTools listening on ws://127.0.0.1:62814/devtools/browser/01199af5-22cf-41b7-bcd3-97d0897ae6aa
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706514300327 Marionette INFO Stopped listening on port 62823
|
||||
Dynamically enable window occlusion 1
|
||||
1706514922174 geckodriver INFO Listening on 127.0.0.1:63252
|
||||
1706514925215 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "632 ... 3" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilelVlH90"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706514925495 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706514925555 Marionette INFO Listening on port 63262
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63253
|
||||
Read port: 63262
|
||||
1706514925709 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63253/devtools/browser/d3da3617-71da-44de-b975-e8eea482dc70
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706514938955 Marionette INFO Stopped listening on port 63262
|
||||
Dynamically enable window occlusion 1
|
||||
1706515338529 geckodriver INFO Listening on 127.0.0.1:63526
|
||||
1706515341570 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "635 ... 7" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileDi4qHi"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706515341847 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706515341907 Marionette INFO Listening on port 63537
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63527
|
||||
Read port: 63537
|
||||
1706515342062 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63527/devtools/browser/92e1cfaf-7409-43d8-b126-50545f1fbf92
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706515363367 Marionette INFO Stopped listening on port 63537
|
||||
Dynamically enable window occlusion 1
|
||||
1706516149647 geckodriver INFO Listening on 127.0.0.1:63943
|
||||
1706516152684 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "639 ... 4" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofileazI0M0"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706516152984 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706516153052 Marionette INFO Listening on port 63952
|
||||
WebDriver BiDi listening on ws://127.0.0.1:63944
|
||||
Read port: 63952
|
||||
1706516153219 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:63944/devtools/browser/d55fa28a-9c0e-4279-a98a-f0ccaa3e3050
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706516168425 Marionette INFO Stopped listening on port 63952
|
||||
Dynamically enable window occlusion 1
|
||||
1706518095157 geckodriver INFO Listening on 127.0.0.1:64915
|
||||
1706518098180 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--headless" "--remote-debugging-port" "649 ... 6" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\voglt\\AppData\\Local\\Temp\\rust_mozprofilekaMdvh"
|
||||
*** You are running in headless mode.
|
||||
console.warn: services.settings: Ignoring preference override of remote settings server
|
||||
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
|
||||
1706518098458 Marionette INFO Marionette enabled
|
||||
Dynamically enable window occlusion 0
|
||||
1706518098517 Marionette INFO Listening on port 64924
|
||||
Read port: 64924
|
||||
WebDriver BiDi listening on ws://127.0.0.1:64916
|
||||
1706518098569 RemoteAgent WARN TLS certificate errors will be ignored for this session
|
||||
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
|
||||
console.error: ({})
|
||||
DevTools listening on ws://127.0.0.1:64916/devtools/browser/ace986c4-fd65-4286-a2ae-48363fc44cdc
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
1706518128501 addons.xpi ERROR System addon update list error SyntaxError: XMLHttpRequest.open: 'http://%(server)s/dummy-system-addons.xml' is not a valid URL.
|
||||
JavaScript error: resource://gre/modules/XULStore.sys.mjs, line 60: Error: Can't find profile directory.
|
||||
Exiting due to channel error.
|
||||
@@ -0,0 +1,453 @@
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from random import randint
|
||||
import time
|
||||
import json
|
||||
import sys
|
||||
from elasticsearch import Elasticsearch
|
||||
import xmltodict
|
||||
|
||||
es = Elasticsearch({'host':'inse.nes.uni-due.de', 'port': 443, 'path_prefix':'elastic', 'scheme':'https'}, basic_auth=('elastic', 'RLldUaJgbGeoqd3KCX3p'), request_timeout=60, max_retries=5, retry_on_timeout=True)
|
||||
|
||||
index_name = "projects_eu_ude"
|
||||
|
||||
def getXML(driver, link):
|
||||
link_xml = link + "?format=xml"
|
||||
driver.get(link_xml)
|
||||
|
||||
time.sleep(randint(10, 20))
|
||||
|
||||
xml = driver.page_source
|
||||
xml = xmltodict.parse(xml)
|
||||
|
||||
data = {}
|
||||
data["source"] = "EU"
|
||||
data["link"] = link
|
||||
|
||||
data["id"] = xml.get('project').get('id')
|
||||
data["acronym"] = xml.get('project').get('acronym')
|
||||
data["teaser"] = xml.get('project').get('teaser')
|
||||
data["objective"] = xml.get('project').get('objective')
|
||||
data["title"] = xml.get('project').get('title')
|
||||
data["totalCost"] = xml.get('project').get('totalCost')
|
||||
data["ecMaxContribution"] = xml.get('project').get('ecMaxContribution')
|
||||
data["startDate"] = xml.get('project').get('startDate')
|
||||
data["endDate"] = xml.get('project').get('endDate')
|
||||
|
||||
try:
|
||||
data["funding_start"] = data["startDate"][:4]
|
||||
data["funding_end"] = data["endDate"][:4]
|
||||
except:
|
||||
pass
|
||||
|
||||
data["status"] = xml.get('project').get('status')
|
||||
data["keywords"] = xml.get('project').get('keywords')
|
||||
keywords_nested = []
|
||||
if data["keywords"] is not None:
|
||||
words = data["keywords"].split(', ')
|
||||
for word in words:
|
||||
keywords_nested.append( {"keyword": word} )
|
||||
data["keywords_nested"] = keywords_nested
|
||||
try:
|
||||
data["doi"] = xml.get('project').get('identifiers').get('grantDoi')
|
||||
except:
|
||||
pass
|
||||
|
||||
relations = xml.get('project').get('relations')
|
||||
if relations is not None:
|
||||
associations = relations.get('associations')
|
||||
if associations is not None:
|
||||
programme = associations.get('programme')
|
||||
if programme is not None:
|
||||
programme_nested = []
|
||||
if type(programme) == list:
|
||||
for p in programme:
|
||||
programme_nested.append( {"programme": p.get('title'), "id": p.get('id'), "code": p.get('code')} )
|
||||
else:
|
||||
programme_nested.append( {"programme": programme.get('title'), "id": programme.get('id'), "code": programme.get('code')} )
|
||||
data["programme_nested"] = programme_nested
|
||||
|
||||
organization = associations.get('organization')
|
||||
if organization is not None:
|
||||
organization_nested = []
|
||||
if type(organization) == list:
|
||||
for o in organization:
|
||||
organization_nested.append( {"id": o.get('id'), "name": o.get('legalName'), "type": o.get('@type'), "ecContribution": o.get('@ecContribution'), "netEcContribution": o.get('@netEcContribution'), "totalCost": o.get('@totalCost')} )
|
||||
else:
|
||||
organization_nested.append( {"id": organization.get('id'), "name": organization.get('legalName'), "type": organization.get('@type'), "ecContribution": organization.get('@ecContribution'), "netEcContribution": organization.get('@netEcContribution'), "totalCost": organization.get('@totalCost')} )
|
||||
data["organization_nested"] = organization_nested
|
||||
|
||||
upload_data(data)
|
||||
|
||||
def check_elastic_online():
|
||||
if not es.ping():
|
||||
sys.exit("No connection to Elasticsearch")
|
||||
|
||||
def check_elastic_index():
|
||||
if not es.indices.exists(index=index_name):
|
||||
settings = {
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"searchabilityAnalyzer": {
|
||||
"type": "custom",
|
||||
"tokenizer": "standard",
|
||||
"filter": [
|
||||
"lowercase",
|
||||
"asciifolding"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mappings = {
|
||||
"properties": {
|
||||
"source": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"link": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"acronym": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"teaser": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"title": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"totalCost": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"ecMaxContribution": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"startDate": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"endDate": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"funding_start": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"funding_end": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"doc_number": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"keywords": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"doi": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"keywords_nested": {
|
||||
"type": "nested",
|
||||
"properties": {
|
||||
"keyword": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"programme_nested": {
|
||||
"type": "nested",
|
||||
"properties": {
|
||||
"programme": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"code": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"organization_nested": {
|
||||
"type": "nested",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"ecContribution": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"netEcContribution": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
},
|
||||
"totalCost": {
|
||||
"type": "text",
|
||||
"analyzer": "searchabilityAnalyzer",
|
||||
"search_analyzer": "searchabilityAnalyzer",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 250
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
es.indices.create(index=index_name, mappings=mappings, settings=settings)
|
||||
|
||||
def upload_data(data):
|
||||
print("Uploading")
|
||||
|
||||
try:
|
||||
id = data["id"]
|
||||
es.index(index=index_name, id=id, document=data)
|
||||
except Exception as e:
|
||||
print("Error while uploading data")
|
||||
print(e)
|
||||
|
||||
# main - entry point
|
||||
if __name__ == '__main__':
|
||||
print("Starting")
|
||||
|
||||
check_elastic_online()
|
||||
check_elastic_index()
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
sys.exit("No path given. Give path to links.json")
|
||||
|
||||
with open(sys.argv[1], "r", encoding='utf-8') as json_links_file:
|
||||
json_links = json.load(json_links_file)
|
||||
|
||||
options = Options()
|
||||
options.add_argument("--headless")
|
||||
|
||||
driver = webdriver.Firefox(options=options)
|
||||
|
||||
print("Getting data.")
|
||||
|
||||
for hit in json_links:
|
||||
link = hit["EU"]
|
||||
|
||||
print(f"{link}")
|
||||
|
||||
try:
|
||||
getXML(driver, link)
|
||||
except:
|
||||
print("Error!")
|
||||
continue
|
||||
|
||||
driver.close()
|
||||
|
||||
print("Finished")
|
||||
@@ -0,0 +1,153 @@
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.common.exceptions import WebDriverException
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from selenium.webdriver.support.ui import Select
|
||||
from random import randint
|
||||
import time
|
||||
import json
|
||||
import sys
|
||||
|
||||
def crawl_links(side, data):
|
||||
options = Options()
|
||||
options.add_argument("--headless")
|
||||
|
||||
driver = webdriver.Firefox(options=options)
|
||||
|
||||
links = []
|
||||
|
||||
driver.get(side["start-url"])
|
||||
|
||||
# always wait so everything can be loaded
|
||||
time.sleep(10)
|
||||
|
||||
if side["long_waits"] == "True":
|
||||
|
||||
breakup_counter = 0
|
||||
while True:
|
||||
try:
|
||||
path = side["link_1"] + str(1) + side["link_2"]
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
breakup_counter = breakup_counter + 1
|
||||
if breakup_counter == 150:
|
||||
raise Exception
|
||||
time.sleep(3)
|
||||
|
||||
|
||||
if side["cookies"] == "True":
|
||||
try:
|
||||
driver.find_element(By.XPATH, side["cookies_button"].replace("'", '"')).click()
|
||||
|
||||
time.sleep(3)
|
||||
except NoSuchElementException as nsee:
|
||||
pass
|
||||
|
||||
if side["search"] == "True":
|
||||
field = driver.find_element(By.XPATH, side["field"].replace("'", '"'))
|
||||
field.clear()
|
||||
field.send_keys(side["string"])
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
driver.find_element(By.XPATH, side["button"]).click()
|
||||
|
||||
time.sleep(5)
|
||||
|
||||
selector_counter = 1
|
||||
|
||||
while True:
|
||||
try:
|
||||
counter = 1
|
||||
|
||||
while counter <= int(side["link_max"]):
|
||||
path = side["link_1"] + str(counter) + side["link_2"]
|
||||
counter += 1
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
links.append(link)
|
||||
|
||||
except NoSuchElementException as nsee:
|
||||
break
|
||||
|
||||
time.sleep(randint(1, 5))
|
||||
|
||||
if side["page_button"] == "True":
|
||||
try:
|
||||
driver.find_element(By.XPATH, side["next_page"]).click()
|
||||
|
||||
if side["long_waits"] == "False":
|
||||
time.sleep(randint(1, 5))
|
||||
else:
|
||||
breakup_counter = 0
|
||||
while True:
|
||||
try:
|
||||
path = side["link_1"] + str(1) + side["link_2"]
|
||||
link = driver.find_element(By.XPATH, path).get_attribute('href')
|
||||
|
||||
break
|
||||
except NoSuchElementException as nsee:
|
||||
breakup_counter = breakup_counter + 1
|
||||
if breakup_counter == 150:
|
||||
raise Exception
|
||||
time.sleep(3)
|
||||
|
||||
except WebDriverException as wde:
|
||||
break
|
||||
|
||||
if side["page_selector"] == "True":
|
||||
selector = driver.find_element(By.XPATH, side["selector"].replace("'", '"'))
|
||||
all_options = selector.find_elements(By.TAG_NAME, "option")
|
||||
|
||||
if selector_counter == len(all_options):
|
||||
break
|
||||
|
||||
next_value = all_options[selector_counter].get_attribute("value")
|
||||
selector_counter += 1
|
||||
|
||||
|
||||
Select(selector).select_by_value(next_value)
|
||||
|
||||
time.sleep(randint(1, 5))
|
||||
|
||||
# close driver
|
||||
driver.close()
|
||||
|
||||
print(len(links))
|
||||
add_data(links, side["name"], data)
|
||||
|
||||
def add_data(links, name, data):
|
||||
for link in links:
|
||||
data.append({f"{name}": link})
|
||||
|
||||
def write_data(data):
|
||||
print(len(data))
|
||||
with open("links.json", "w") as f:
|
||||
json.dump(data, f)
|
||||
|
||||
# main - entry point
|
||||
if __name__ == '__main__':
|
||||
print("Starting")
|
||||
|
||||
data = []
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
sys.exit("No path given. Give path to links_config.json")
|
||||
|
||||
with open(sys.argv[1], "r", encoding='utf-8') as json_file:
|
||||
json_loaded = json.load(json_file)
|
||||
|
||||
for side in json_loaded:
|
||||
name = side["name"]
|
||||
print(f"Getting links from {name}.")
|
||||
try:
|
||||
crawl_links(side, data)
|
||||
except:
|
||||
print(f"Error while getting {name}-links. Check links_config.json!")
|
||||
|
||||
print("Writing links.")
|
||||
write_data(data)
|
||||
|
||||
print("Finished")
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"name": "EU",
|
||||
"start-url": "https://cordis.europa.eu/search?q=contenttype%3D%27project%27%20AND%20(%27Universit%C3%A4t%27%20AND%20%27Duisburg-Essen%27)&p=1&num=50&srt=Relevance:decreasing",
|
||||
"cookies": "True",
|
||||
"cookies_button": "/html/body/app-root/app-cookies-consent/div/div/div/button[2]",
|
||||
"search": "False",
|
||||
"page_button": "True",
|
||||
"next_page": "/html/body/app-root/div[2]/ng-component/div[3]/app-cordis-search-results/div/section[2]/app-pagination/div/nav/ul[3]/li[1]/a",
|
||||
"page_selector": "False",
|
||||
"link_max": "50",
|
||||
"link_1": "/html/body/app-root/div[2]/ng-component/div[3]/app-cordis-search-results/div/section[1]/app-card-search[",
|
||||
"link_2": "]/div/div[2]/a",
|
||||
"long_waits": "True"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user