Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segmentfault的地址变了 #17

Open
lightlogic5 opened this issue Aug 18, 2019 · 1 comment
Open

segmentfault的地址变了 #17

lightlogic5 opened this issue Aug 18, 2019 · 1 comment

Comments

@lightlogic5
Copy link

segmentfault的前端地址变成了https://segmentfault.com/channel/frontend
每个文章下面有含有图片也有不包含图片的,所以有的就有2个a标签,有的有1个a标签
选择器应该怎么写呢,我是下面这样的,但是是错的
var list = [...document.querySelectorAll('.news-list .news__item-info a:not([class$="news-img"])')]

@zds-d
Copy link

zds-d commented Mar 16, 2020

segmentfault的前端地址变成了https://segmentfault.com/channel/frontend
每个文章下面有含有图片也有不包含图片的,所以有的就有2个a标签,有的有1个a标签
选择器应该怎么写呢,我是下面这样的,但是是错的
var list = [...document.querySelectorAll('.news-list .news__item-info a:not([class$="news-img"])')]

 var SfFeArticleList = await page.evaluate(() => {
        var $ = window.$;
        return Array.from($('.news-list .news__item-info').map((index, el) => {
            const item = $(el).find('a[target=_blank]');
            return {
                href: SfUrl + item.attr("href"),
                title: item.find('.news__item-title').text()
            };
        }));
    })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants