Upload files to "source/Confluence"
This commit is contained in:
109
source/Confluence/test.ipynb
Normal file
109
source/Confluence/test.ipynb
Normal file
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from selenium import webdriver\n",
|
||||
"import json\n",
|
||||
"import getpass"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"name = 'lawi'"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{\n",
|
||||
" \"job_description\": \"Senior Consultant (L2201)\",\n",
|
||||
" \"role\": \"Senior Consultant\",\n",
|
||||
" \"email\": \"Lasse.Wiedemann@crossnative.com\",\n",
|
||||
" \"phone number\": \"+4943188810-0\",\n",
|
||||
" \"location\": \"GS Hamburg\",\n",
|
||||
" \"business area\": \"GB PPI-X\",\n",
|
||||
" \"unit\": \"X-Consulting, sada\",\n",
|
||||
" \"team\": \"CX, sada, Team DnA olsc\",\n",
|
||||
" \"supervisor\": \"Ole Schmidt (olsc)\"\n",
|
||||
"}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"driver = webdriver.Chrome()\n",
|
||||
"driver.get(\"https://confluence.ppi.de\")\n",
|
||||
"getpass.getpass(\"Press Enter after You are done logging in\")\n",
|
||||
"driver.get(\"https://confluence.ppi.de/masterprofiles/viewprofile.action?username=\" + name)\n",
|
||||
"general = driver.find_element(\"id\", \"general-de\")\n",
|
||||
"table = general.find_element(\"tag name\", \"tbody\")\n",
|
||||
"job_description = general.find_element(\"xpath\", \"./p/span\").text \n",
|
||||
"role = general.find_element(\"xpath\", \"./p/i\").text\n",
|
||||
"email = table.find_element(\"xpath\", \"./tr[1]/td[2]/a/h4\").text\n",
|
||||
"phone_number = table.find_element(\"xpath\", \"./tr[2]/td[2]/a/h4\").text\n",
|
||||
"location = table.find_element(\"xpath\", \"./tr[4]/td[2]/h4\").text\n",
|
||||
"business_area = table.find_element(\"xpath\", \"./tr[5]/td[2]/h4\").text\n",
|
||||
"unit = table.find_element(\"xpath\", \"./tr[6]/td[2]/h4\").text\n",
|
||||
"team = table.find_element(\"xpath\", \"./tr[7]/td[2]/h4\").text\n",
|
||||
"supervisor = table.find_element(\"xpath\", \"./tr[8]/td[2]/a/h4\").text\n",
|
||||
"persis_info = {\n",
|
||||
" \"job_description\": job_description,\n",
|
||||
" \"role\": role,\n",
|
||||
" \"email\": email,\n",
|
||||
" \"phone number\": phone_number,\n",
|
||||
" \"location\": location,\n",
|
||||
" \"business area\": business_area,\n",
|
||||
" \"unit\": unit,\n",
|
||||
" \"team\": team,\n",
|
||||
" \"supervisor\": supervisor\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"print(json.dumps(persis_info, indent=4))\n",
|
||||
"\n",
|
||||
"driver.close()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.9"
|
||||
},
|
||||
"orig_nbformat": 4
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
Reference in New Issue
Block a user