1)
driver.execute_script(f'document.documentElement.scrollTop={(i+1)*1000}')
lis = driver.find_elements_by_css_selector('#root > div > div.T_foQflM > div > div > div.ckqOrial > div. mwbaK9mv > div:nth-child(2) > ul > li:nth-child(4)')
for li in lis:
herf = li.find_elements_by_css_selector('a').get_attribute('herf')
print(herf)
Running result and error content
runfile('D:/anaconda/练习/伊素婉.py', wdir='D:/anaconda/练习')
Traceback (most recent call last):
File "D:\anaconda\练习\伊素婉.py", line 22, in
lis = driver.find_e...
< div class = " md_content_show“数据- v - 3967 e397 = " " >
< div class = " aw-list-img >
#这样子不行
if li == "[]":
print("[0]")
else:
print(li.xpath("./div/div/p[3]/a/text()"))
#这样子不行
for li in result:
if li.xpath("./div/div/p[3]/a/text()") == "[]":
print("[0]")
else:
print(li.xpath("./div/div/p[3]/a/text()"))
这些也不行
if li.xpath("./div/div/p[3]/a/te xt()") == None:
if li == None:
if li == '[]':
...
HTML static web page how to achieve the transmission between data, the shopping cart calculated goods total price transfer to the settlement page.
This is the code for the shopping cart secti on
购物车
{{item.name}}
¥{{item.price}}
-
...