質問編集履歴
1
試行錯誤のために作成していたほうのファイルを投稿していました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -58,7 +58,7 @@
|
|
58
58
|
sold = 1
|
59
59
|
|
60
60
|
#URLを取得
|
61
|
-
URL = post.
|
61
|
+
URL = post.find_element_by_css_selector("a").get_attribute("href")
|
62
62
|
se = pd.series([title, price, sold, URL],columns)
|
63
63
|
df = df.append(se, columns)
|
64
64
|
|
@@ -81,7 +81,20 @@
|
|
81
81
|
```エラー(ユーザー名をuserに変更している)
|
82
82
|
1ページを取得中
|
83
83
|
Traceback (most recent call last):
|
84
|
-
File "C:\
|
84
|
+
File "C:\Python\test0.py", line 55, in <module>
|
85
|
-
URL =
|
85
|
+
URL = post.find_element_by_css_selector("a").get_attribute("href")
|
86
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 430, in find_element_by_css_selector
|
87
|
+
return self.find_element(by=By.CSS_SELECTOR, value=css_selector)
|
88
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 659, in find_element
|
89
|
+
{"using": by, "value": value})['value']
|
90
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
|
91
|
+
return self._parent.execute(command, params)
|
92
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
|
86
|
-
|
93
|
+
self.error_handler.check_response(response)
|
94
|
+
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
|
95
|
+
raise exception_class(message, screen, stacktrace)
|
96
|
+
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"a"}
|
97
|
+
(Session info: chrome=77.0.3865.120)
|
98
|
+
|
99
|
+
|
87
100
|
```
|