Mid.py 262 B

123456789101112
  1. from lxml import etree
  2. def get_mid(html):
  3. selector = etree.HTML(html)
  4. mid = selector.xpath('//div[@class="card-wrap"]')
  5. mid_str = []
  6. for i in mid:
  7. temp = i.get("mid")
  8. if temp:
  9. mid_str.append(temp)
  10. return mid_str