Skip to content

Commit e5f787b

Browse files
committed
Merge branch 'dev'
2 parents 4a64e4d + 0b53f0c commit e5f787b

File tree

1 file changed

+41
-46
lines changed

1 file changed

+41
-46
lines changed

02_selenium/02_selenium_google_search.ipynb

Lines changed: 41 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
{
1616
"cell_type": "code",
1717
"execution_count": 1,
18-
"metadata": {
19-
"collapsed": true
20-
},
18+
"metadata": {},
2119
"outputs": [],
2220
"source": [
2321
"import os\n",
@@ -41,69 +39,66 @@
4139
"text": [
4240
"======================================================================================= Page 0\n",
4341
"title: 人工智能- 维基百科,自由的百科全书\n",
44-
"url: \n",
45-
"---\n",
46-
"title: AI 人工智慧| TechNews 科技新報\n",
47-
"url: \n",
42+
"url: https://zh.wikipedia.org/zh-tw/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD\n",
4843
"---\n",
49-
"title: 台灣人工智慧學校| Taiwan AI Academy\n",
50-
"url: \n",
44+
"title: 人工智慧三大關鍵技術 - 數位時代\n",
45+
"url: https://www.bnext.com.tw/article/41534/3-key-techniques-of-ai\n",
5146
"---\n",
52-
"title: 11個趨勢預測:人工智慧將會如何影響人類的職業?|數位時代\n",
53-
"url: \n",
47+
"title: AI 人工智慧| TechNews 科技新報\n",
48+
"url: https://technews.tw/category/cutting-edge/ai/\n",
5449
"---\n",
55-
"title: 首頁 - 2017 台灣人工智慧年會-人工智慧.智慧台灣\n",
56-
"url: \n",
50+
"title: 人工智慧不可能超越人類,原因居然是這樣的……(上) |智慧機器人網 ...\n",
51+
"url: https://www.limitlessiq.com/news/post/view/id/3596/\n",
5752
"---\n",
58-
"title: 【AI流言終結者】超級人工智慧的未來,我們該擔心什麼? - Myths and ...\n",
59-
"url: \n",
53+
"title: 人工智慧AI – CASE報科學 - 國立臺灣大學科學教育發展中心\n",
54+
"url: https://case.ntu.edu.tw/blog/?cat=3772\n",
6055
"---\n",
61-
"title: 台灣人工智慧年會- 首頁| Facebook\n",
62-
"url: \n",
56+
"title: AI人工智慧來了! 你的未來在哪裡?|深度專題|天下雜誌\n",
57+
"url: https://www.cw.com.tw/special/2073\n",
6358
"---\n",
64-
"title: 【2017兩千大企業調查】AI全面啟動:台灣機器人百強企業出列!-天下雜誌\n",
65-
"url: \n",
59+
"title: 台灣人工智慧學校| Taiwan AI Academy\n",
60+
"url: http://aiacademy.tw/\n",
6661
"---\n",
67-
"title: 人工智慧(Artificial Intelligence) | Coursera\n",
68-
"url: \n",
62+
"title: 人工智慧- MBA智库百科\n",
63+
"url: https://wiki.mbalib.com/zh-tw/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD\n",
6964
"---\n",
7065
"======================================================================================= Page 1\n",
71-
"title: 人工智慧(Artificial Intelligence) | Coursera\n",
72-
"url: \n",
66+
"title: 什麼是人工智慧?︱《三分鐘財經教室》#01 - YouTube\n",
67+
"url: https://www.youtube.com/watch?v=nKcsu4JierI\n",
7368
"---\n",
74-
"title: NVIDIA 深度學習和人工智慧的最新消息\n",
75-
"url: \n",
69+
"title: 『AI人工智慧!機器學習& 突如其來的危機』芬特克FinTech EP3 - YouTube\n",
70+
"url: https://www.youtube.com/watch?v=i0UxYDqlX6o\n",
7671
"---\n",
77-
"title: 人工智慧產學研聯盟--首頁\n",
78-
"url: \n",
72+
"title: 人工智慧:搜尋方法與邏輯推論(Artificial Intelligence - Search & Logic ...\n",
73+
"url: https://www.coursera.org/learn/rengong-zhineng\n",
7974
"---\n",
80-
"title: 人工智慧學校開學了!2千萬買GPU設備養AI尖兵| 數位焦點| 數位| 聯合 ...\n",
81-
"url: \n",
75+
"title: 博客來-中文書>電腦資訊>概論/科技趨勢>人工智慧/機器學習\n",
76+
"url: https://www.books.com.tw/web/sys_bbotm/books/190102\n",
8277
"---\n",
83-
"title: 未來「產業創新」的秘密武器:AI 人工智慧- The News Lens 關鍵評論網\n",
84-
"url: \n",
78+
"title: 人工智能| 大紀元\n",
79+
"url: http://www.epochtimes.com/b5/tag/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD.html\n",
8580
"---\n",
86-
"title: 人工智慧| TechOrange - BuzzOrange\n",
87-
"url: \n",
81+
"title: 如何對面AI時代的孩子?人工智慧博士教年輕父母強化個人實力- Yahoo ...\n",
82+
"url: https://tw.news.yahoo.com/%E5%A6%82%E4%BD%95%E5%B0%8D%E9%9D%A2ai%E6%99%82%E4%BB%A3%E7%9A%84%E5%AD%A9%E5%AD%90-%E4%BA%BA%E5%B7%A5%E6%99%BA%E6%85%A7%E5%8D%9A%E5%A3%AB%E6%95%99%E5%B9%B4%E8%BC%95%E7%88%B6%E6%AF%8D%E5%BC%B7%E5%8C%96%E5%80%8B%E4%BA%BA%E5%AF%A6%E5%8A%9B-010012301.html\n",
8883
"---\n",
89-
"title: 人工智能「被駭」的結果出人意料| 人工智慧| 計算機| Google人工智慧系統 ...\n",
90-
"url: \n",
84+
"title: 人工智慧對勞動就業的影響- STPI Research Portal - 科技政策觀點\n",
85+
"url: https://portal.stpi.narl.org.tw/index/article/10401\n",
9186
"---\n",
92-
"title: 【神逮捕片】人工智慧打擊犯罪系統日本神奈川縣考慮引進| 蘋果日報\n",
93-
"url: \n",
87+
"title: AI人工智慧時代來臨- 中時電子報\n",
88+
"url: https://www.chinatimes.com/newspapers/20180907000541-260204\n",
9489
"---\n",
95-
"title: 人工智慧- MBA智库百科\n",
96-
"url: \n",
90+
"title: 人工智慧應用新趨勢與展望—學生與機器人共同學習-臺北產經資訊網\n",
91+
"url: https://www.taipeiecon.taipei/article_cont.aspx?MmmID=1201&MSid=1001302007727155764\n",
9792
"---\n",
98-
"title: 博客來-中文書>電腦資訊>概論/科技趨勢>人工智慧/機器學習\n",
99-
"url: \n",
93+
"title: 人工智慧技術的下一波研發核心 - Digitimes\n",
94+
"url: https://www.digitimes.com.tw/col/article.asp?id=944\n",
10095
"---\n"
10196
]
10297
}
10398
],
10499
"source": [
105100
"try:\n",
106-
" driver = webdriver.Chrome()\n",
101+
" driver = webdriver.Chrome('/home/afun/Downloads/chromedriver')\n",
107102
" driver.get(url)\n",
108103
" driver.maximize_window()\n",
109104
" driver.implicitly_wait(10)\n",
@@ -115,14 +110,14 @@
115110
" for i in range(2):\n",
116111
" print('='*87, 'Page {}'.format(i))\n",
117112
"\n",
118-
" links = driver.find_elements(By.XPATH, '//h3[@class=\"r\"]/a[@href]')\n",
113+
" links = driver.find_elements(By.XPATH, '//div[@class=\"r\"]/a[@href]')\n",
119114
"\n",
120115
" for link in links:\n",
121-
" page_title = link.text\n",
116+
" page_title = link.find_element(By.TAG_NAME, 'h3').text\n",
122117
" page_url = ''\n",
123118
"\n",
124119
" if link.get_attribute('href'):\n",
125-
" url = link.get_attribute('href')\n",
120+
" page_url = link.get_attribute('href')\n",
126121
"\n",
127122
" print('title: {}\\nurl: {}\\n---'.format(page_title, page_url))\n",
128123
"\n",
@@ -151,7 +146,7 @@
151146
"name": "python",
152147
"nbconvert_exporter": "python",
153148
"pygments_lexer": "ipython3",
154-
"version": "3.5.2"
149+
"version": "3.6.6"
155150
}
156151
},
157152
"nbformat": 4,

0 commit comments

Comments
 (0)