利用CSS爬取属性

import requests
import re
from fontTools.ttLib import TTFont
from lxml import etree
from aip import AipOcr  #pip install baidu-aip
from parsel import Selector
url = "https://s.gxrc.com/sJob?schType=1&expend=1&PosType=5833"
response = requests.get(url=url)
response.encoding = 'utf-8'
html_data = response.text
sel = Selector(html_data) 
for i in range(1,11):
    url_name="https:"+sel.css('div#posList>div:nth-of-type({})>ul>li>h3>a::attr("href")'.format(str(i))).extract_first()
    print(url_name)

你可能感兴趣的:(css,url,python,爬虫)