Issue
I couldn't find all 'href' by "find_elements_by_xpath" Is there another way to find data? thx
!pip install selenium
from selenium import webdriver
import time
import pandas as pd
browser = webdriver.Chrome(executable_path='./chromedriver.exe')
browser.implicitly_wait(5)
browser.get("https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons")
linkPath = '//ul[@class = "sc-eWvPqa cePswM"]/li/a'
product_links = browser.find_elements_by_xpath(linkPath)
print(product_links)
Solution
href
is attribute
of the anchor tag.
so this xpath
//a
should locate all of them.
or in Selenium
you can use tag_name
as well. I will use XPath,
browser = webdriver.Chrome(executable_path='./chromedriver.exe') browser.get("https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons")
browser.maximize_window()
linkPath = "//a"
product_links = browser.find_elements(By.XPATH, linkPath)
print(len(product_links))
for link in product_links:
print(link.get_attribute('href'))
Output:
288
https://tw.yahoo.com/
https://tw.buy.yahoo.com/
https://tw.bid.yahoo.com/
https://tw.usedcar.yahoo.com/
https://tw.mall.yahoo.com/activity?p=mall-1-0-180921-channelgroupbuy
http://mail.yahoo.com.tw/
https://yahoomode.tumblr.com/yahooapp/
https://tw.mall.yahoo.com/
https://tw.mall.yahoo.com/search/store?p=
https://tw.user.mall.yahoo.com/my/home
https://tw.sc.mall.yahoo.com/mcart/preview
https://tw.user.mall.yahoo.com/my/order/orderList
https://login.yahoo.com/config/login?.intl=tw&.src=mktg1&done=https%3A%2F%2Ftw.mall.yahoo.com%2Fstore%2Fwatsons
https://tw.user.mall.yahoo.com/my/point
https://tw.mall.yahoo.com/
https://tw.user.mall.yahoo.com/my/home
https://tw.user.mall.yahoo.com/my/order/orderList
https://tw.user.mall.yahoo.com/sc/view/home
https://tw.user.mall.yahoo.com/my/notification
https://tw.user.mall.yahoo.com/my/point
https://tw.user.mall.yahoo.com/my/order/ratingList
https://tw.user.mall.yahoo.com/my/followupStore
https://tw.user.mall.yahoo.com/my/watchlist
https://tw.user.mall.yahoo.com/my/ecoupon
https://tw.user.mall.yahoo.com/my/voucher/unused
https://tw.user.mall.yahoo.com/my/member
https://tw.user.mall.yahoo.com/my/setting
https://tw.user.mall.yahoo.com/my/customerqa
https://tw.help.yahoo.com/kb/shopping-mall-web/SLN35152.html
https://tw.mall.yahoo.com/
https://tw.mall.yahoo.com/store/watsons
https://tw.mall.yahoo.com/store/watsons
https://tw.mall.yahoo.com/store/watsons
https://tw.mall.yahoo.com/store/watsons/rating/list
https://tw.mall.yahoo.com/chat/watsons
https://tw.mall.yahoo.com/store/watsons/stIntroMgt
https://tw.mall.yahoo.com/store_vip/watsons
https://tw.mall.yahoo.com/store/watsons/stNoteMgt
https://tw.mall.yahoo.com/store/watsons/edm
https://tw.mall.yahoo.com/store/watsons
None
None
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=2689&path=2689
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=2797&path=2797
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=712&path=712
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=664&path=664
None
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=1553&path=1553
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=2505&path=2505
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=1452&path=1452
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=1060&path=1060
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=827&path=827
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=1003&path=1003
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=1024&path=1024
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=875&path=875
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=958&path=958
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=979&path=979
https://tw.mall.yahoo.com/store_vip/watsons
https://tw.mall.yahoo.com/store/watsons/promo
https://tw.rcv.mall.yahoo.com/rcv/askEcoupon?s=5Ir7dQTxCtYebEIVRr7qdbQJrQ--
https://tw.mall.yahoo.com/store/watsons/promoCode?id=407205
https://tw.mall.yahoo.com/store/watsons/amountPromo?promotion_id=3101274
https://tw.mall.yahoo.com/store/watsons/amountPromo?promotion_id=3101277
https://tw.mall.yahoo.com/store/watsons/amountPromo?promotion_id=3101328
https://tw.mall.yahoo.com/store/watsons/amountPromo?promotion_id=3101279
https://tw.mall.yahoo.com/store/watsons/amountPromo?promotion_id=3101281
https://tw.mall.yahoo.com/store/watsons/amountPromo?promotion_id=3101286
https://tw.mall.yahoo.com/store/watsons/amountPromo?promotion_id=3101276
https://tw.mall.yahoo.com/store/watsons/amountPromo?promotion_id=3101216
https://tw.mall.yahoo.com/store/watsons/amountPromo?promotion_id=3101318
https://tw.mall.yahoo.com/store/watsons/amountPromo?promotion_id=3101272
https://tw.mall.yahoo.com/store/watsons/amountPromo?promotion_id=3101228
https://tw.mall.yahoo.com/store/watsons/amountPromo?promotion_id=3101287
https://tw.mall.yahoo.com/store/watsons
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4792&path=4792
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4802&path=4793,4802
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4805&path=4794,4805
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4807&path=4794,4807
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4799&path=4793,4799
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4801&path=4793,4801
https://tw.mall.yahoo.com/search?q=%E6%B4%BB%E6%B2%9B%E5%A4%9A&sid=watsons
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=1539
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4810&path=4794,4810
https://tw.mall.yahoo.com/search?q=%E6%B4%BB%E6%B2%9B%E5%A4%9A&sid=watsons
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4806&path=4794,4806
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4806&path=4794,4806
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4800&path=4793,4800
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4800&path=4793,4800
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4812&path=4793,4812
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4812&path=4793,4812
https://tw.mall.yahoo.com/search?m=list&sid=watsons
https://tw.mall.yahoo.com/search?q=%E7%BE%8E%E8%88%92%E5%BE%8B&sid=watsons
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=3283&path=2689,3283
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4808&path=4794,4808
https://tw.mall.yahoo.com/search?m=list&sid=watsons&ccatid=4809&path=4794,4809
https://tw.mall.yahoo.com/search?q=%E8%92%82%E8%8A%AC%E5%A6%AE%E4%BA%9E&sid=watsons
https://member.watsons.com.tw/NewsView.aspx?NewsID=AhmGIZT9gReFoAM18vHFyA%3d%3d
https://member.watsons.com.tw/NewsView.aspx?NewsID=PIzM00tt2hmQiVi9trVqWg%3d%3d
https://tw.mall.yahoo.com/activity?p=mall-1-0-200422-member
https://tw.mall.yahoo.com/item/p0330180543850
https://tw.mall.yahoo.com/item/p0330231079018
https://tw.mall.yahoo.com/item/p0330149612638
https://tw.mall.yahoo.com/item/p033089261341
https://tw.mall.yahoo.com/item/p0330190914741
https://tw.mall.yahoo.com/item/p0330206204422
https://tw.mall.yahoo.com/item/p033053127759
https://tw.mall.yahoo.com/item/p0330207304791
https://tw.mall.yahoo.com/item/p0330228841925
https://tw.mall.yahoo.com/item/p0330226336955
https://tw.mall.yahoo.com/item/p0330119743323
https://tw.mall.yahoo.com/item/p0330180543850
https://tw.mall.yahoo.com/item/p0330106434075
https://tw.mall.yahoo.com/item/p0330229833822
https://tw.mall.yahoo.com/item/p033098709784
https://tw.mall.yahoo.com/item/p03304442775
https://tw.mall.yahoo.com/item/p0330226584503
https://tw.mall.yahoo.com/item/p0330142835205
https://tw.mall.yahoo.com/item/p0330230215997
https://tw.mall.yahoo.com/item/p03304614678
https://tw.mall.yahoo.com/item/p033014991670
https://tw.mall.yahoo.com/item/p033041688721
https://tw.mall.yahoo.com/item/p0330172392339
https://tw.mall.yahoo.com/item/p0330222713237
https://tw.mall.yahoo.com/item/p033058974074
https://tw.mall.yahoo.com/item/p0330143315411
https://tw.mall.yahoo.com/item/p0330220872850
https://tw.mall.yahoo.com/item/p0330231079018
https://tw.mall.yahoo.com/item/p033092697026
https://tw.mall.yahoo.com/item/p0330219296877
https://tw.mall.yahoo.com/item/p0330230912735
https://tw.mall.yahoo.com/item/p0330230651934
https://tw.mall.yahoo.com/item/p0330199709328
https://tw.mall.yahoo.com/item/p0330229012247
https://tw.mall.yahoo.com/item/p0330142835202
https://tw.mall.yahoo.com/item/p0330158688717
https://tw.mall.yahoo.com/item/p0330227790346
None
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=4792
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=4793
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=4794
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=2689
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=3122
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=3126
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=3285
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=3952
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=3415
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=2150
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=2797
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=3155
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=757
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=749
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=740
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=3063
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=3312
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=3352
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=731
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=3061
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=712
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=664
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=1553
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=2505
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=1452
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=1539
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=1060
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=1046
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=827
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=1003
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=1024
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=875
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=918
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=2937
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=958
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=979
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=1797
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=2691
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=3186
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=2865
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=939
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=892
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=1757
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=4431
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ccatid=2950
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pay=zero
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pay=card
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pay=store
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pay=install
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ship=711
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ship=family
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ship=hilife_pick
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?ship=hilife_cash_on_delivery
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?status=instk
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?status=video
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?minr=1
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?minr=2
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?minr=3
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?minr=4
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?minr=5
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?s=-createtime
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?s=-rating
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?s=-rating_count
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?s=price
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?s=-price
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?view=both
https://tw.mall.yahoo.com/item/p0330231079018
https://tw.mall.yahoo.com/item/p0330221397264
https://tw.mall.yahoo.com/item/p0330201617111
https://tw.mall.yahoo.com/item/p0330149612638
https://tw.mall.yahoo.com/item/p0330199239561
https://tw.mall.yahoo.com/item/p0330157722030
https://tw.mall.yahoo.com/item/p0330195847496
https://tw.mall.yahoo.com/item/p0330199516056
https://tw.mall.yahoo.com/item/p033018957484
https://tw.mall.yahoo.com/item/p03304110080
https://tw.mall.yahoo.com/item/p0330180543850
https://tw.mall.yahoo.com/item/p0330182407803
https://tw.mall.yahoo.com/item/p0330127191918
https://tw.mall.yahoo.com/item/p033016523362
https://tw.mall.yahoo.com/item/p0330223567951
https://tw.mall.yahoo.com/item/p0330195847488
https://tw.mall.yahoo.com/item/p0330175780701
https://tw.mall.yahoo.com/item/p0330157492679
https://tw.mall.yahoo.com/item/p03304614678
https://tw.mall.yahoo.com/item/p033018936979
https://tw.mall.yahoo.com/item/p0330128871794
https://tw.mall.yahoo.com/item/p0330208015628
https://tw.mall.yahoo.com/item/p0330230696349
https://tw.mall.yahoo.com/item/p0330225341921
https://tw.mall.yahoo.com/item/p033076908568
https://tw.mall.yahoo.com/item/p0330226395844
https://tw.mall.yahoo.com/item/p03304110059
https://tw.mall.yahoo.com/item/p03304109225
https://tw.mall.yahoo.com/item/p0330194282004
https://tw.mall.yahoo.com/item/p0330224835920
https://tw.mall.yahoo.com/item/p0330228042972
https://tw.mall.yahoo.com/item/p0330106434075
https://tw.mall.yahoo.com/item/p03304109964
https://tw.mall.yahoo.com/item/p0330162452392
https://tw.mall.yahoo.com/item/p0330207304791
https://tw.mall.yahoo.com/item/p033076908463
https://tw.mall.yahoo.com/item/p03304057564
https://tw.mall.yahoo.com/item/p033037459923
https://tw.mall.yahoo.com/item/p0330212962835
https://tw.mall.yahoo.com/item/p0330212400568
https://tw.mall.yahoo.com/item/p03304109924
https://tw.mall.yahoo.com/item/p03304109929
https://tw.mall.yahoo.com/item/p0330157347297
https://tw.mall.yahoo.com/item/p033069529068
https://tw.mall.yahoo.com/item/p0330202092777
https://tw.mall.yahoo.com/item/p0330158688717
https://tw.mall.yahoo.com/item/p0330226336941
https://tw.mall.yahoo.com/item/p0330223693370
https://tw.mall.yahoo.com/item/p0330111297761
https://tw.mall.yahoo.com/item/p0330223745715
https://tw.mall.yahoo.com/item/p0330230577786
https://tw.mall.yahoo.com/item/p03304110017
https://tw.mall.yahoo.com/item/p0330107487926
https://tw.mall.yahoo.com/item/p0330101184035
https://tw.mall.yahoo.com/item/p033017662348
https://tw.mall.yahoo.com/item/p033069529070
https://tw.mall.yahoo.com/item/p0330200970871
https://tw.mall.yahoo.com/item/p0330227790329
https://tw.mall.yahoo.com/item/p0330181952679
https://tw.mall.yahoo.com/item/p033064463660
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pg=2
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pg=3
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pg=4
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pg=5
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pg=6
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pg=7
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pg=8
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pg=9
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pg=10
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pg=11
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons?pg=2
https://tw.mall.yahoo.com/chat/watsons?rr=1637492343029
https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons#backToTop
https://itunes.apple.com/tw/app/id778296354?mt=8
https://play.google.com/store/apps/details?id=com.yahoo.mobile.client.android.ecstore&hl=zh_TW
https://www.facebook.com/Ybestbuy
https://tw.mall.yahoo.com/activity?p=mall-1-0-200424-newcorp003
https://tw.mall.yahoo.com/help/help.html
https://tw.mall.yahoo.com/help/return.html
https://policies.yahoo.com/tw/zh-hant/yahoo/terms/utos/index.htm
Due to language constraint, I could not differentiate products on the page.
I think they are located by
//a[@rel='nofollow']
XPath.
Update 1 :
linkPath = "//a"
product_links = driver.find_elements(By.XPATH, linkPath)
print(len(product_links))
for link in product_links:
address = link.get_attribute('href')
try:
if '/item/p' in address:
print(address)
except:
pass
Output :
https://tw.mall.yahoo.com/item/p0330180543850
https://tw.mall.yahoo.com/item/p0330231079018
https://tw.mall.yahoo.com/item/p0330149612638
https://tw.mall.yahoo.com/item/p033089261341
https://tw.mall.yahoo.com/item/p0330190914741
https://tw.mall.yahoo.com/item/p0330206204422
https://tw.mall.yahoo.com/item/p033053127759
https://tw.mall.yahoo.com/item/p0330207304791
https://tw.mall.yahoo.com/item/p0330228841925
https://tw.mall.yahoo.com/item/p0330226336955
https://tw.mall.yahoo.com/item/p0330230651934
https://tw.mall.yahoo.com/item/p033098709784
https://tw.mall.yahoo.com/item/p0330229833822
https://tw.mall.yahoo.com/item/p0330142835202
https://tw.mall.yahoo.com/item/p0330227790346
https://tw.mall.yahoo.com/item/p0330172392339
https://tw.mall.yahoo.com/item/p0330226584503
https://tw.mall.yahoo.com/item/p0330220872850
https://tw.mall.yahoo.com/item/p0330180543850
https://tw.mall.yahoo.com/item/p0330230215997
https://tw.mall.yahoo.com/item/p0330199709328
https://tw.mall.yahoo.com/item/p0330229012247
https://tw.mall.yahoo.com/item/p0330142835205
https://tw.mall.yahoo.com/item/p03304614678
https://tw.mall.yahoo.com/item/p033058974074
https://tw.mall.yahoo.com/item/p03304442775
https://tw.mall.yahoo.com/item/p033092697026
https://tw.mall.yahoo.com/item/p0330230912735
https://tw.mall.yahoo.com/item/p0330106434075
https://tw.mall.yahoo.com/item/p0330222713237
https://tw.mall.yahoo.com/item/p0330119743323
https://tw.mall.yahoo.com/item/p033041688721
https://tw.mall.yahoo.com/item/p0330231079018
https://tw.mall.yahoo.com/item/p0330158688717
https://tw.mall.yahoo.com/item/p033014991670
https://tw.mall.yahoo.com/item/p0330219296877
https://tw.mall.yahoo.com/item/p0330143315411
https://tw.mall.yahoo.com/item/p0330231079018
https://tw.mall.yahoo.com/item/p0330221397264
https://tw.mall.yahoo.com/item/p0330201617111
https://tw.mall.yahoo.com/item/p0330149612638
https://tw.mall.yahoo.com/item/p0330199239561
https://tw.mall.yahoo.com/item/p0330157722030
https://tw.mall.yahoo.com/item/p0330195847496
https://tw.mall.yahoo.com/item/p0330199516056
https://tw.mall.yahoo.com/item/p033018957484
https://tw.mall.yahoo.com/item/p03304110080
https://tw.mall.yahoo.com/item/p0330180543850
https://tw.mall.yahoo.com/item/p0330182407803
https://tw.mall.yahoo.com/item/p0330127191918
https://tw.mall.yahoo.com/item/p033016523362
https://tw.mall.yahoo.com/item/p0330223567951
https://tw.mall.yahoo.com/item/p0330195847488
https://tw.mall.yahoo.com/item/p0330175780701
https://tw.mall.yahoo.com/item/p0330157492679
https://tw.mall.yahoo.com/item/p03304614678
https://tw.mall.yahoo.com/item/p033018936979
https://tw.mall.yahoo.com/item/p0330128871794
https://tw.mall.yahoo.com/item/p0330208015628
https://tw.mall.yahoo.com/item/p0330230696349
https://tw.mall.yahoo.com/item/p0330225341921
https://tw.mall.yahoo.com/item/p033076908568
https://tw.mall.yahoo.com/item/p0330226395844
https://tw.mall.yahoo.com/item/p03304110059
https://tw.mall.yahoo.com/item/p0330194282004
https://tw.mall.yahoo.com/item/p03304109225
https://tw.mall.yahoo.com/item/p0330224835920
https://tw.mall.yahoo.com/item/p0330228042972
https://tw.mall.yahoo.com/item/p0330106434075
https://tw.mall.yahoo.com/item/p0330162452392
https://tw.mall.yahoo.com/item/p03304109964
https://tw.mall.yahoo.com/item/p0330207304791
https://tw.mall.yahoo.com/item/p03304057564
https://tw.mall.yahoo.com/item/p033076908463
https://tw.mall.yahoo.com/item/p033037459923
https://tw.mall.yahoo.com/item/p0330212962835
https://tw.mall.yahoo.com/item/p0330157347297
https://tw.mall.yahoo.com/item/p03304109929
https://tw.mall.yahoo.com/item/p0330212400568
https://tw.mall.yahoo.com/item/p03304109924
https://tw.mall.yahoo.com/item/p033069529068
https://tw.mall.yahoo.com/item/p0330202092777
https://tw.mall.yahoo.com/item/p0330158688717
https://tw.mall.yahoo.com/item/p0330226336941
https://tw.mall.yahoo.com/item/p0330223693370
https://tw.mall.yahoo.com/item/p0330111297761
https://tw.mall.yahoo.com/item/p0330223745715
https://tw.mall.yahoo.com/item/p0330230577786
https://tw.mall.yahoo.com/item/p0330101184035
https://tw.mall.yahoo.com/item/p03304110017
https://tw.mall.yahoo.com/item/p0330107487926
https://tw.mall.yahoo.com/item/p033017662348
https://tw.mall.yahoo.com/item/p0330200970871
https://tw.mall.yahoo.com/item/p033069529070
https://tw.mall.yahoo.com/item/p0330227790329
https://tw.mall.yahoo.com/item/p033064463660
https://tw.mall.yahoo.com/item/p0330181952679
Answered By - cruisepandey
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.