How to print the partial text from an element using Selenium and Python

后端 未结 2 682
栀梦
栀梦 2021-01-27 12:01

I am trying to get the text \"Album Vol.1 [Every letter I sent you] LP (Normal Edition)\" from http://www.ktown4u.com/iteminfo?grp_no=231307&goods_no=44363#dt_wrap01 under t

2条回答
  •  無奈伤痛
    2021-01-27 12:35

    With this xpath:

    '//div[@id="contents"]/div/div/div[2]/span'
    

    Test in dev tools:

    $x('//div[@id="contents"]/div/div/div[2]/span')[0].textContent
    "Album Vol.1 [Every letter I sent you] LP (Normal Edition)"
    

提交回复
热议问题