Skip to content

Instantly share code, notes, and snippets.

@eugene87222
Last active May 7, 2020 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eugene87222/8386433cc4596f18fe4e82a59267ea53 to your computer and use it in GitHub Desktop.
Save eugene87222/8386433cc4596f18fe4e82a59267ea53 to your computer and use it in GitHub Desktop.
20200507 ccca 爬蟲社課 Python demo
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"content:\n",
"\n",
" \n",
"\n",
"【轉知】經濟部工業局推動「5G+產業新星揚帆啟航計畫」,歡迎踴躍報名。\n",
" \n",
"\n",
"一、本計畫主要以鏈結國內外產學研培訓能量,建立全國唯一5G產業課程及技術資源平台,並辦理一系列前瞻技術工作坊/論壇/交流會,希冀廣召全國企業參與,以學生、應屆畢業生為對象(以下稱產業新星),推動企業運用本計畫建置之培訓資源,進行企業內訓及5G研發專題實作,期能孕育高品質的5G技術與應用人才,促進我國5G產業及人才升級,驅動產業數位轉型及5G創新應用。5G參考領域包括:\n",
"\n",
"\n",
"(一)天線:如陣列天線、多輸入多輸出系統、巨量天線、主動式天線系統、波束成形、天線封裝/模組技術等。\n",
"\n",
"\n",
"(二)射頻:如微波/毫米波、射頻主被動元件、射頻收發模組/射頻傳收機、射頻前端模組等。\n",
"\n",
"\n",
"(三)晶片封測:如IC封裝/組裝、先進封裝技術、集成電路設計、IC測試、前段晶圓測試、封裝後測試等。\n",
"\n",
"\n",
"(四)關鍵材料(晶片/PCB):如高頻/高速基板(基材)、關鍵零組件、天線單元材料、射頻系統材料、構裝/製程材料等。\n",
"\n",
"\n",
"(五)小基站/無線接取:如電信/通訊系統、無線接取技術、5GNR新空中介面、基站系統、小基站分割架構等。\n",
"\n",
"\n",
"(六)SDN/NFV解決方案:如軟體定義網路架構、網路切片、邊緣運算、網路功能虛擬化、開源軟體、白盒硬體等。\n",
"\n",
"(七)應用:如智慧城市、車聯網/自動駕駛、工業物聯網等。\n",
"\n",
"二、申請資格:學校為教育部核定之中華民國公私立大專校院(以下簡稱大專校院)。產業新星應具備中華民國國籍,(一)學生:109學年度第一學期就讀於我國大專校院不限科系,為:1.四年制大學、科技大學、技術學院三年級(含)以上在學生,不含在職生;2.二年制大學、科技大學、技術學院一年級(含)以上在學生,不含在職生;3.大學、科技大學、技術學院碩士一年級(含)以上在學生,不含在職生;4.大學、科技大學、技術學院博士一年級(含)以上?學生,不含在職生。(二)應屆畢業生:108學年度畢業,且於109年8月31日前取得畢業證書者(男性須為役畢或符合免役資格),不含在職生。請至計畫網站(https://www.5g-jump.org.tw)下載申請須知。\n",
"\n",
"\n",
"三、請大專校院有意參加本計畫之產業新星,須於109年5月18日(週一)前至計畫網站:https://www.5g-jump.org.tw自行上傳相關履歷資料。\n",
"\n",
"四、敬請參與計畫之產業新星至計畫網站報名時,務必將大專校院名稱點選正確,並記得點選送出,各校窗口才能於系統上點選欲推薦的產業新星。\n",
"\n",
"五、凡企業錄取之產業新星自109年7月21日至109年12月20日止(5個月)由本計畫給付每人每月專題津貼,學士級的專題津貼為每月新臺幣6,000元;碩士級以上(含博士)的專題津貼為每月新臺幣10,000元(相關薪資福利由企業自行與所錄取的產業新星議定之)。\n",
"\n",
"六、諮詢聯絡人:吳佳穎小姐(聯絡電話:02-6631-6682)\n",
" \n",
"\n",
"\n",
"\n"
]
}
],
"source": [
"# 交大首頁公告\n",
"import requests\n",
"from bs4 import BeautifulSoup\n",
"\n",
"url = 'https://infonews.nctu.edu.tw/index.php?SuperType=2&action=more&pagekey=1&categoryid=all'\n",
"headers = {\n",
" 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0'\n",
"}\n",
"\n",
"res = requests.get(url, headers=headers)\n",
"res.encoding = 'big5' # 重新編碼,不然抓出來通通亂碼\n",
"soup = BeautifulSoup(res.text, 'lxml')\n",
"table = soup.select_one('.category-style')\n",
"rows = table.select('tr')\n",
"post = rows[1:4] # 跳過第一個 row 之後,每三個 row 一組\n",
"url = post[0].find('a')['href']\n",
"url = 'https://infonews.nctu.edu.tw/' + url\n",
"\n",
"res = requests.get(url, headers=headers)\n",
"res.encoding = 'big5'\n",
"soup = BeautifulSoup(res.text, 'lxml')\n",
"table = soup.select_one('#post1')\n",
"rows = table.select('tr')\n",
"print('content:')\n",
"print(rows[9].text) # 這邊就是寫死,自己算內文在第幾個 tr 裡面"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.7.5 64-bit",
"language": "python",
"name": "python37564bit9c3aa344ed5e49b1b7f5168b1a98152a"
},
"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.7.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment