Git Product home page Git Product logo

learningpanda's People

Watchers

 avatar

learningpanda's Issues

> > 代码有问题,第8行你把关键字str赋值了,会报错

代码有问题,第8行你把关键字str赋值了,会报错

追踪HTTP协议后发现在json请求后有个时间戳信息,估计是用来抓刷机的,现将带时间戳的请求修改如下(还是修改get_links.py文件,暂时修改文章列表获取方法,估计不久视频列表也会发生变化):

import requests
import re
import time
def get_article_links():
    try:
        t_str=int(time.time()/60)
        url="https://www.xuexi.cn/lgdata/u1ght1omn2.json?_st=" + str(t_str)
        str=requests.get(url)
        strList=str.json()
        links=[]
        for i in strList:
            links.append(i['url'])
        return links

    except:
        print("=" * 120)
        print("get_article_links获取失败")
        print("=" * 120)
        raise

把第八行的str和下面的str改成其他变量即可,疏忽了。
谢谢指正

感谢,可用谢谢

Originally posted by @ZhaoqiangCn in Alivon/Panda-Learning#403 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.