質問編集履歴

3

更新

2021/01/21 12:00

投稿

ruei
ruei

スコア284

test CHANGED
File without changes
test CHANGED
@@ -30,6 +30,8 @@
30
30
 
31
31
  この class の要素であることは chrome developer tool を使って確かめました。
32
32
 
33
+
34
+
33
35
  しかし、
34
36
 
35
37
  ```
@@ -53,3 +55,41 @@
53
55
 
54
56
 
55
57
  解決策をご教授ください。
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+ **更新:2021/01/21**
66
+
67
+ 申し訳ありません、上の現象は検索結果から遷移したページにおいて発生することが分かりました。
68
+
69
+ つまり、下記のようなコードです。こちらの場合はまだ解決できていないのですが、ご助言いただけないでしょうか。
70
+
71
+ ```
72
+
73
+ import chromedriver_binary
74
+
75
+ from selenium import webdriver
76
+
77
+
78
+
79
+ url="https://www.ebay.com/sch/i.html?_from=R40&_nkw=Roland+MT-32&_sacat=0&_sop=16&_fcid=1&LH_Sold=1&LH_Complete=1&rt=nc&_udlo=10000"
80
+
81
+ driver = webdriver.Chrome()
82
+
83
+ driver.get(url)
84
+
85
+ driver.find_element_by_class_name("s-item__link").click()
86
+
87
+ if str(driver.current_url) == url:
88
+
89
+ driver.find_element_by_class_name("s-item__link").click()
90
+
91
+ ret = str(driver.find_element_by_class_name("u-flL w29 vi-price-np").text)
92
+
93
+ driver.quit()
94
+
95
+ ```

2

リンク

2021/01/21 12:00

投稿

ruei
ruei

スコア284

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,12 @@
1
- [商品ページ](https://www.ebay.com/itm/Roland-MT-32-Sound-Module/224200244704?epid=1930304477&hash=item3433603de0:g:OJMAAOSwTjRfcYoO) の AU $699.00 の部分を Selenium で取得したいと考えております。
1
+ [商品ページ](https://www.ebay.com/itm/Roland-MT-32-Sound-Module-/224200244704?_trksid=p2349526.m4383.l10137.c10&nordt=true&rt=nc&orig_cvip=true) の AU $699.00 の部分を Selenium で取得したいと考えております。
2
+
3
+
4
+
5
+ ![イメージ説明](bea39f379bfb8229c7dc66a780bad820.png)
6
+
7
+
8
+
9
+ The listing you're looking for has ended. に飛ばされる場合は、view original item をクリックしてください。
2
10
 
3
11
 
4
12
 
@@ -12,7 +20,7 @@
12
20
 
13
21
  driver = webdriver.Chrome()
14
22
 
15
- url = "https://www.ebay.com/itm/Roland-MT-32-Sound-Module/224200244704?epid=1930304477&hash=item3433603de0:g:OJMAAOSwTjRfcYoO"
23
+ url = "https://www.ebay.com/itm/Roland-MT-32-Sound-Module-/224200244704?_trksid=p2349526.m4383.l10137.c10&nordt=true&rt=nc&orig_cvip=true"
16
24
 
17
25
  driver.get(url)
18
26
 

1

url誤り

2021/01/21 07:03

投稿

ruei
ruei

スコア284

test CHANGED
File without changes
test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  driver.get(url)
18
18
 
19
- driver.find_element_by_class("notranslate vi-VR-cvipPrice").text
19
+ driver.find_element_by_class_name("notranslate vi-VR-cvipPrice").text
20
20
 
21
21
  ```
22
22