美文网首页
Python 26 Programming Tutorial

Python 26 Programming Tutorial

作者: 豆表示低调 | 来源:发表于2016-08-31 11:40 被阅读0次
    import requests
    from bs4 import BeautifulSoup
    
    def get_info(max_page):
       page= 1
       while page<=max_page:
           url = r'http://www.buckyslockerroom.com/Wisconsin-Men-s-Apparel-s/180.htm?searching=Y&sort=5&cat=180&show=90&page=' + str(page)
           source_code = requests.get(url)
           plain_text= source_code.text
           txt = BeautifulSoup(plain_text)
           for link in txt.findAll('a', {'class':'v-product__title productnamecolor colors_productname'}):
               href = link.get('href')
               print(href)
    
    
    
    get_info(1)
    

    相关文章

      网友评论

          本文标题:Python 26 Programming Tutorial

          本文链接:https://www.haomeiwen.com/subject/sdvfettx.html