質問編集履歴
1
サイト情報をxxxへ切り替え
test
CHANGED
File without changes
|
test
CHANGED
@@ -166,7 +166,7 @@
|
|
166
166
|
|
167
167
|
# URLを開く
|
168
168
|
|
169
|
-
url = "https://www.
|
169
|
+
url = "https://www.xxx.php?=60&p={}".format(page)
|
170
170
|
|
171
171
|
browser.get(url)
|
172
172
|
|
@@ -178,17 +178,15 @@
|
|
178
178
|
|
179
179
|
review_links = []
|
180
180
|
|
181
|
-
# date_list = []
|
182
|
-
|
183
181
|
date_src_list = []
|
184
182
|
|
185
183
|
for elem in elems:
|
186
184
|
|
187
185
|
#各elemからimgタグのsrcを一覧で出す
|
188
186
|
|
189
|
-
review_score_src = elem.find_element_by_class_name('ItemList__
|
187
|
+
review_score_src = elem.find_element_by_class_name('ItemList__xxx').find_element_by_tag_name('img').get_attribute('src')
|
190
|
-
|
188
|
+
|
191
|
-
if review_score_src == 'https://www.
|
189
|
+
if review_score_src == 'https://www.xxx.jp/static/xxx/images/pic_star0.png':
|
192
190
|
|
193
191
|
pass
|
194
192
|
|
@@ -206,9 +204,7 @@
|
|
206
204
|
|
207
205
|
browser.get(contain_review_link)
|
208
206
|
|
209
|
-
# 商品ページからレビュー一覧へ
|
210
|
-
|
211
|
-
review_list_src = browser.find_element_by_css_selector('.
|
207
|
+
review_list_src = browser.find_element_by_css_selector('.xxx').get_attribute('href')
|
212
208
|
|
213
209
|
browser.get(review_list_src)
|
214
210
|
|
@@ -216,15 +212,13 @@
|
|
216
212
|
|
217
213
|
|
218
214
|
|
219
|
-
pr_name = browser.find_element_by_css_selector('.
|
215
|
+
pr_name = browser.find_element_by_css_selector('.xxx').text
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
216
|
+
|
224
|
-
|
217
|
+
|
218
|
+
|
225
|
-
review_table = browser.find_elements_by_css_selector('.
|
219
|
+
review_table = browser.find_elements_by_css_selector('.xxx')[2]
|
226
|
-
|
227
|
-
|
220
|
+
|
221
|
+
|
228
222
|
|
229
223
|
review_lists = review_table.find_elements_by_css_selector('tr')[1:]
|
230
224
|
|
@@ -292,11 +286,11 @@
|
|
292
286
|
|
293
287
|
src = img.get_attribute("src")
|
294
288
|
|
295
|
-
if src == 'https://www.
|
289
|
+
if src == 'https://www.xxx.jp/xxx/images/common/star_a.png':
|
296
290
|
|
297
291
|
review_score += 1
|
298
292
|
|
299
|
-
review = review_box.find_element_by_css_selector('.c
|
293
|
+
review = review_box.find_element_by_css_selector('.cxxx').text
|
300
294
|
|
301
295
|
csv_list.append(product_name)
|
302
296
|
|