某某宝典爬虫

import requests
import execjs

js_code = """
function c(t=1) {
    var a, i, n = Math.abs(parseInt((new Date).getTime() * Math.random() * 1e4)).toString(), o = 0;
    for (a = 0; a < n.length; a++)
        o += parseInt(n[a]);
    return i = function(t) {
        return function(a, i) {
            return i - "" + a.length <= 0 ? a : (t[i] || (t[i] = Array(i + 1).join(0))) + a
        }
    }([]),
    o += n.length,
    o = i(o, 3 - o.toString().length),
    t.toString() + n + o
}
"""
ctx = execjs.compile(js_code)


headers = {
    "authority": "api2.jiakaobaodian.com",
    "accept": "*/*",
    "accept-language": "zh-CN,zh;q=0.9",
    "cache-control": "no-cache",
    "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
    "origin": "https://www.jiakaobaodian.com",
    "pragma": "no-cache",
    "referer": "https://www.jiakaobaodian.com/",
    "sec-ch-ua-mobile": "?0",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-site",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36",
    "x-data-type": "json",
    "x-requested-with": "XMLHttpRequest"
}
url = "https://api2.jiakaobaodian.com/api/open/question/question-list.htm"
all_value = ["800500","800900","801200","801300","801400","802000","802100","802300","802400","802500","802600","802700","802800","803200","803600","803700","803800","804000","804100","804200","804300","804400","824500","824600","824700","824800","824900","825000","825100","825200","825300","825400","825500","825600","825700","825900","826000","826100","826200","826300","826400","826500","826600","826700","826800","826900","830500","831500","831600","831700","831900","832000","832100","832200","832400","832500","832600","832700","832800","833000","833100","833200","833400","833500","833600","833700","833800","834100","834200","834500","834600","834800","835200","835300","835600","835900","836100","836200","836300","836400","1119200","1119400","1119500","1119600","1119800","1119900","1120800","1120900","1121000","1121100","1121200","1121300","1121500","1122500","1122600","1122800","1122900","1123700","1123900","1124600","1124700","1124800","1124900","1125000","1125100","1125200","1126200","1126500","1126600","1126700","1127000","1127100","1128800","1128900","1129000","1129300","1129400","1129800","1131000","1131300","1132100","1132500","1133700","1134000","1134100","1134700","1156100","5632100","10007800","11853300","11857300","11920200","11921200","11937500","11937600","11962600","11962800","11977000","11977200","11977300","11996400","11998400","11999900","12005900","12008600","12008700","12010600","12012600","12013000","12013400","12023600","12023700","12024600","12025200","12030700","12033100","12086200","12517800","12527000","12533000","12933600","13073900","13128900","13129500","13142800","13152500","13156200","13157400","13395500","13829900","13880500","14233500","14357200","14357300","14566100","14607700","14608000","14608100","14610700","14610800","14611800","14612000","14612200","14612300","14612400","14612600","14612800","14613000","14613100","14613200","14613400","14613500","14613600","14613800","14614000","14614300","14614400","14616300","14616500","14616600","14617100","14617300","14617500","14617900","14621200","14622000","14622100","14622200","14622300","14622900","14623200","14623700","14624400","14624800","14625000","14625100","14625300","14625700","14626200","14626500","14626600","14626800","14627700","14628100","14628500","14628900","14629000","14632300","14632400","14633200","14633700","14634900","14636500","14637600","14637800","14637900","14638000","14638100","14638200","14638300","14638400","14638500","14638700","14638800","14638900","14639000","14639100","14639200","14639300","14639400","14639500","14639600","14639700","14639800","14639900","14640000","14640100","14640300","14640400","14640500","14640600","14640700","14640800","14641100","14641200","14641300","14641400","14641500","14641600","14641800","14641900","14642000","14642100","14642200","14642300","14642400","14642500","14642600","14642700","14642900","14643100","14643200","14643300","14643400","14643500","14643600","14643700","14643800","14643900","14644000","14644100","14644300","14644400","14644500","14646900","14647100","14647500","14647900","14648400","14648500","14649000","14649700","14650000","14650200","14650300","14650800","14656600","14695300","14696600","14697300","15156400","15245300","15245700","15246000","15246200","15296800","15296900","15491400","15491500","18363100","18369200","18370000","18377000","23174800","23175500","23209100","23209200","803000","803400","803500","804500","804600","804700","804800","804900","805000","805100","805200","805300","805400","805500","805600","805700","805800","805900","806000","806100","806200","806300","806400","806500","806600","806700","806800","806900","807000","807100","807200","807300","807400","807500","807600","807700","807800","807900","808000","808100","808200","808400","808500","808600","808700","808800","808900","809000","809100","809200","809300","809400","809500","809600","809700","809800","809900","810000","810100","810200","810300","810400","810500","810600","810700","810800","810900","811000","811100","811200","811300","811400","811500","811600","811700","811800","811900","812000","812100","812200","812300","812400","812500","812600","812700","812800","812900","813000","813100","813200","813300","813400","813500","813600","813700","813900","814000","814100","814200","814300","814400","814500","814600","814700","814800","814900","815000","815100","815200","815300","815400","815500","815600","815700","815800","815900","816000","816100","816200","816300","816400","816500","816600","816700","816900","817000","817100","817200","817300","817400","817500","817600","818100","818200","818300","818400","818500","819100","819200","819300","819400","819500","819600","819700","819800","819900","820000","820200","820300","820400","820500","820600","820700","820800","820900","821000","821100","821200","821300","821400","821500","821600","821700","821800","821900","822000","822100","822300","822400","822500","822600","822700","822800","822900","823000","823700","823800","823900","824000","824100","824200","824300","824400","827100","827200","836500","836600","836700","836900","837100","837200","837300","837400","837600","837800","837900","838000","838100","838300","838400","838600","838700","838800","839000","839100","839200","839300","839400","839500","839600","839700","839800","839900","840000","840100","840200","840300","840400","840500","840600","840700","840800","840900","841000","841100","841200","841300","841400","841500","841600","841700","841800","841900","842000","842100","842200","842300","842400","842500","842600","842700","842800","842900","843000","843100","843200","843300","843400","843500","843600","843700","843800","843900","844000","844100","844200","844300","844400","844500","844600","844700","844800","844900","845000","845100","845200","845300","845400","845500","845600","845700","845800","845900","846000","846100","846200","846300","846400","846500","846600","846700","846800","846900","847000","847100","847200","847300","847400","847500","847600","847700","847800","847900","848000","848100","848200","848300","848400","848500","848600","848700","848800","848900","849000","849100","849200","849300","849400","849500","849600","849700","849800","849900","850000","850100","850200","850300","850400","850500","850600","850700","850800","850900","851000","851200","851300","851400","851500","851600","851700","851800","851900","852000","852100","852200","852300","852400","852500","852600","852700","852800","852900","853000","853100","853200","853300","853400","853500","853600","853700","853800","853900","854000","854100","854200","854300","854400","854500","854600","854700","854800","854900","855000","855100","855200","855300","855400","855500","855600","855700","855800","855900","856000","856100","856200","856300","856400","856500","856600","856700","856800","856900","857000","857100","857200","857300","857400","857500","857600","857700","857800","857900","858000","858100","858200","858300","858400","858500","858600","858700","858800","858900","859000","859100","859200","859300","859400","859500","859600","859700","859800","859900","860000","860100","860200","860300","860400","860500","860600","860700","860800","860900","861000","861100","861200","861300","861400","861500","861600","861700","861800","861900","862000","862100","862200","862300","862400","862500","862600","862700","862800","862900","863000","863100","863200","863300","863400","863500","863600","863700","863800","863900","864000","864100","864200","864300","864400","864600","864700","864800","864900","865000","865100","865200","865300","865400","865500","865600","865800","865900","866000","866100","866200","866300","866400","866500","866600","866700","866800","866900","867000","867100","867200","867300","867400","867500","867600","867900","868100","868200","868300","868400","868500","868800","868900","869000","869100","869200","869300","869400","869700","869800","870000","870100","870200","870300","870400","870500","870600","870700","870800","871000","871100","871200","871300","871400","871500","871600","871900","872000","872100","872200","872300","872400","872500","872600","872700","872800","872900","873100","873200","873300","873400","873500","873600","873700","873800","873900","874000","874200","874400","874500","874600","874700","874800","874900","875000","875100","875200","875300","875400","875500","875600","875700","875900","876000","876100","876300","876400","876500","876600","876800","877000","877200","877300","877400","877500","877600","877800","877900","878000","878100","878200","878400","878500","878600","878700","878800","878900","879000","879100","879200","879400","879500","879600","879700","879800","879900","880000","880100","880300","880400","880500","880700","880800","881000","881100","881400","881500","881600","881700","881800","881900","882000","882100","882200","882300","882400","882600","882900","883000","883200","883400","883700","883800","884000","884400","884600","884800","884900","885100","885200","885300","885600","885700","885800","885900","886000","886100","886200","1092200","1092300","1092500","1092600","1092800","1093000","1093100","1093200","1093300","1093400","1093500","1093700","1093800","1093900","1094000","1094100","1094300","1094400","1094500","1094600","1094700","1094800","1094900","1095000","1095100","1095200","1095300","1095400","1095500","1095600","1095700","1095800","1095900","1096000","1096200","1096300","1096500","1096600","1096700","1096800","1097000","1097100","1097200","1097300","1097400","1097500","1097600","1097700","1097800","1097900","1098000","1098100","1098200","1098300","1098400","1098500","1098600","1098700","1099100","1099200","1099300","1099400","1099500","1099600","1099700","1099800","1099900","1100000","1100100","1100200","1100300","1100400","1100600","1100700","1100800","1100900","1101000","1101100","1101200","1101300","1101400","1101500","1101600","1101700","1101800","1120000","1120100","1120200","1120300","1120400","1120500","1120600","1120700","1121600","1121700","1121800","1121900","1122000","1122100","1122200","1123100","1123300","1123400","1123500","1124000","1124100","1124200","1124300","1125400","1125500","1125600","1125700","1125800","1125900","1126000","1126800","1127200","1127300","1127400","1127600","1127700","1127800","1127900","1128000","1128200","1128300","1128400","1129500","1129600","1129700","1129900","1130000","1130100","1130200","1130300","1130400","1130500","1131200","1131500","1131600","1131700","1131800","1132000","1132200","1132300","1132400","1132600","1132700","1132900","1133000","1133100","1133200","1133300","1133400","1134200","1134300","1134400","1134500","1154200","1155500","1155600","1155700","1155800","1155900","1156000","1156200","1156300","1156400","1156500","1156600","1156700","1156800","1157000","1157100","1157200","1157300","1157400","1157500","1157600","1157700","1157800","1157900","1158000","1158100","1158200","1158300","1158400","1158500","1158600","1158700","1158800","1158900","1159000","1159100","1159200","1159300","1159400","1159500","1159600","1159700","1159800","1159900","1160000","1160100","1160200","1160300","1160700","1160800","1161000","1161100","1161200","1162100","1163200","1188100","5632200","5632300","5632400","10957900","10958200","11851400","11852000","11852100","11852500","11854300","11854400","11854500","11855100","11855600","11855800","11856100","11856500","11856800","11858000","11858500","11858600","11858900","11859000","11859900","11860000","11860100","11860200","11860500","11861200","11861300","11861600","11861700","11861800","11861900","11862000","11862600","11921300","11921800","11921900","11926300","11936200","11936400","11936500","11936600","11936700","11936800","11936900","11961700","11962500","11995300","11999000","11999600","12001400","12005500","12006600","12007900","12009100","12011100","12011800","12011900","12023000","12024700","12030900","12031400","12032100","12033200","12179600","12256100","12257100","12257200","12351000","12351100","12351700","12386800","12386900","12502800","12502900","12517300","12517900","12518500","12519700","12520200","12520300","12529400","12530100","12530700","12531300","12531400","12532200","12532300","12533100","12533200","12533700","12534300","12534400","12535000","12535600","12931900","12932800","13143800","13144400","13146700","13150300","13151000","13151500","13156100","13299400","13425700","13563000","13563100","13563700","13649400","13649500","13777700","13777900","13778100","13778700","13880400","13881200","14232900","14358100","14358700","14359200","14359300","14359900","14360400","14360500","14361100","14505800","14566200","14568000","14568600","14606100","14606700","14607400","14612700","14624900","14625900","14628400","14629400","14629900","14635700","14636900","14637700","14641000","14641700","14642800","14644900","14645100","14645200","14645300","14646100","14646200","14646400","14646500","14646600","14647700","14648100","14649300","14650600","14695800","14696900","14697000","14697800","15154100","15489200","15489300","15489500","15489700","15490000","15490200","15490400","15490500","15490700","15490800","15490900","15491000","15491200","15491300","15491900","15492000","15492100","15492400","15492500","18344700","18345300","18358500","18363200","18363500","18363900","18364900","23175600","23175700","23175800","23175900","23176000","23176100","23176200","23176300","23176400","23176500","23176600","23176700","23176800","23176900","23209300","23209400","23209500","23209800","800000","800100","800200","800300","800400","800600","800700","800800","801500","801700","801900","802200","808300","823500","823600","827000","827300","827400","827500","827600","827700","827800","827900","828000","828100","828200","828300","828400","828500","828600","828900","829000","829300","829400","829500","829600","829700","829800","829900","830000","830100","830200","830300","830400","830600","831800","1092400","1092900","1096400","1096900","1122300","1124400","1126300","1127500","1128500","1130600","1130700","1130900","1133500","1133600","1133800","1133900","1134600","1187500","1188300","1188400","11851800","11852400","11922000","11996800","12000600","12007500","12010200","12012200","12025500","12026600","12034400","12437200","12527100","12932000","13075100","13200900","13685100","13881000","14234300","14234400","14505700","14506300","14567900","14568500","14611100","14620700","14621700","14638600","14646700","14647000","14647800","14695600","15153800","18348300","18356900","18358100","818600","818700","818800","818900","819000","823100","823200","823300","823400","830700","830800","830900","831000","831100","831200","831300","831400","869500","869600","1119700","1122400","1123000","1123200","1124500","1125300","1126100","1126900","1128600","1128700","1155200","1155300","1155400","1160400","1160500","1187800","1187900","1188000","11852900","11853100","11936100","12011000","12033800","12534900","13075000","13144900","13156800","13881100","14358600","14566800","14595300","14623400","14640900","14697400","18343800","18347500","18357000","817700","817800","817900","818000","877700","886400","886500","886600","886700","886800","886900","887000","887100","887200","887300","887400","887500","887600","887700","887800","887900","888000","888100","888200","888300","888400","888500","888600","888700","888800","888900","889000","889100","889200","889300","889400","889500","889600","889700","889800","889900","890000","890100","890200","890300","890400","890500","890600","890700","890800","890900","891000","891100","891200","891300","891400","891500","891600","891700","891800","891900","892000","892100","892200","892300","892400","892500","892600","892700","892800","892900","893000","893100","893200","893300","893400","893500","893600","893700","893800","893900","894000","894100","894200","894300","894400","894500","894600","894700","894800","894900","895000","895100","895200","895300","895400","895500","895600","895700","895800","895900","896000","896100","896200","896300","896400","896500","896600","896700","896800","896900","897000","897100","897200","1100500","1102000","1102100","1131400","1161300","1161400","1161500","1161600","1161700","1161800","1161900","1162000","1162200","1162300","1162400","1162500","1162600","1162700","1162800","1162900","1163000","1163100","1163300","11852200","11937100","11994700","12001600","12519100","12535500","13562400","13685000","14232800","14607300","14637200","14637300","14643000","14645500","14645600","14646300","14646800","18364800","18366200","12002000","12002100","12002200","12002300","12002400","12002500","12002600","12002700","12002800","12002900","12003000","12003100","12003400","12003700","12003800","12003900","12004000","12004100","12004200","12004500","12004600","12004700","12004800","12004900","12005000","12005100","12005200","12256500"]
for i in range(0,len(all_value)+1,25):
    print(i)
    this_params = ','.join(all_value[i:i+25])
    print(this_params)
    result = ctx.call("c")
    print(result)
    params = {
        "_r": result,
        "carType": "car",
        "course": "kemu1",
        "questionIds": this_params,
        "_": "0.23251464117277454"
    }
    response = requests.get(url, headers=headers, params=params)

    if response.json() and response.json().get('data'):
        for each in response.json().get('data'):
            print(each)
            # with open('xx宝典.txt', 'a', encoding='utf-8') as f:
            #     f.write(str(each) + '\n')
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值