Git Product home page Git Product logo

Comments (12)

KB64ba avatar KB64ba commented on August 10, 2024

https://ftp.bmp.ovh/imgs/2020/08/7d7ac4f33316e5d2.jpg
https://ftp.bmp.ovh/imgs/2020/08/a3c41bc2489e8250.jpg

from lazystudy.

lolisaikou avatar lolisaikou commented on August 10, 2024

之前我注意到了,但是这种文章很少出现,能不能提供一下标题的id啊

from lazystudy.

lolisaikou avatar lolisaikou commented on August 10, 2024

已经有通过id获取标题的方法了
image
但是,偶尔有文章还是无法获取标题

from lazystudy.

KB64ba avatar KB64ba commented on August 10, 2024

text = 每日名胜|陕西·秦始皇帝陵博物院

我用4.1.1版本调试发现找不到

if ((id("general_card_title_id").findOnce(t).parent().parent().click() || id("general_card_title_id").findOnce(t).parent().parent().parent().click()) == true) {
同样找不到ID内容

if (id("xxqg-article-header").exists()) {
currentNewsTitle = id("xxqg-article-header").findOne().child(0).text(); // 最终解决办法
//currentNewsTitle = id("xxqg-article-header").findOne().text(); // 最终解决办法
}

这段内容,直接就跳下面了,

提个思路:文章和视频浏览以时间为点击进入浏览,获取文章/视频的标题为浏览成功1分。如果多个账户使用者在开始前把list表的标题清空。这样以当天时间点则不会出现重复浏览无效。

if (textContains("**广播电视总台").exists()) {
currentNewsTitle = textContains("**广播电视总台").findOne().parent().children()[1].text();
console.log("TX来源:"+currentNewsTitle);
} else if (textContains("央视网").exists()) {
currentNewsTitle = textContains("央视网").findOne().parent().children()[1].text();
console.log("TX来源:"+currentNewsTitle);
}

if ( myScores['我要选读文章'] < 6 ) {
DeletelistSql();//文章阅读积分未超过6,说明没有浏览过文章,则清空文章记录
}
/**

  • @description: 删除list.db数据库的记录
  • @param: sql
  • @return: null
    */
    function DeletelistSql( ) {
    var dbName = "list.db";
    var path = files.path(dbName);
    var db = SQLiteDatabase.openOrCreateDatabase(path, null);
    var Deletelistable = "DELETE FROM learnedArticles";
    db.execSQL(Deletelistable);
    db.close();
    console.info("已清空文章阅读记录!");

}

from lazystudy.

lolisaikou avatar lolisaikou commented on August 10, 2024

之前的版本点击是用时间点击的,但是有人说很容易误触,而且容易点到视频,所以才用了控件
找不到控件麻烦检查一下强国的版本,我这边是2.15.1
然后关于数据库,虽然我不是很懂数据库操作。但是如果中间有些原因停止运行,第二次运行的时候肯定会删除数据库导致阅读不得分,不过可以在ui界面加入一个按钮,让大家手动删除

from lazystudy.

KB64ba avatar KB64ba commented on August 10, 2024

刚更新还是不行,ID控制找不到,

currentNewsTitle = textContains("作者").findOne().parent().children()[0].text();
这个获取是第一段文章吗?
截图[https://ftp.bmp.ovh/imgs/2020/08/f05c097b13f09cab.jpg)

from lazystudy.

lolisaikou avatar lolisaikou commented on August 10, 2024
currentNewsTitle = id("xxqg-article-header").findOne().child(0).text();

image
这段是来获取文章标题的

if ((id("general_card_title_id").findOnce(t).parent().parent().click() || id("general_card_title_id").findOnce(t).parent().parent().parent().click()) == true) {}

这段是用来点击进入阅读文章页面的

from lazystudy.

lolisaikou avatar lolisaikou commented on August 10, 2024

别人都能用啊,就你说获取不到标题
剩下的只是id方法获取不到标题,备用的方法

from lazystudy.

KB64ba avatar KB64ba commented on August 10, 2024

https://ftp.bmp.ovh/imgs/2020/08/fada9c6a9432a2c5.png

如图,无解了,我用的auto4.1.1版的

from lazystudy.

lnxcyq avatar lnxcyq commented on August 10, 2024

一是没必要通过标题来判断是否已经阅读过某文章,原来通过日期来判断已经很好的达到目的。二是如果确实要用,那么可以进入文章后获取文章标题,这样就很容易获取标题且不会出错。(也曾尝试过通过收藏按钮是否点亮来判断。就是在每读完文章后点收藏,然后以后就不会再读已经收藏的文章了)

from lazystudy.

KB64ba avatar KB64ba commented on August 10, 2024

一是没必要通过标题来判断是否已经阅读过某文章,原来通过日期来判断已经很好的达到目的。二是如果确实要用,那么可以进入文章后获取文章标题,这样就很容易获取标题且不会出错。(也曾尝试过通过收藏按钮是否点亮来判断。就是在每读完文章后点收藏,然后以后就不会再读已经收藏的文章了)

能给段代码吗? 如果是在订阅项好像有部分没有收藏的

from lazystudy.

lnxcyq avatar lnxcyq commented on August 10, 2024

文章标题:className("android.webkit.WebView").findOnce().text();
收藏点亮判断的代码没用了,一时找不到了。

from lazystudy.

Related Issues (20)

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.