我想用scrapy刮一个wordpress网站。我的问题是我想要标题、文本、日期和作者。作者数据不打印在主要文章上,全文也不在简短版本中。所以我必须先复制作者,然后访问帖子的完整版本以获取文本。我不知道如何将数据从两个 url 发送到同一 csv 行。
所以我想访问https://www.exemple.me/news/page/1/ copy author --> 转到第一篇文章复制标题、日期和文本 --> 将数据存储到 csv(作者、标题、 date,text,) --> 返回https://www.exemple.me/news/page/1/并在第二篇文章中做同样的事情,依此类推..
我知道如何使用选择器,所以我的问题是我无法将数据从两个 url 存储到同一行。
我可以用 selenium 和 BeautifulSoup 做到这一点,但想学习如何在 scrapy 中做到
我是jquery和userscripts的新手.有人可以帮我弄这个吗:
<a class="image is-100x100" href="/profile/myprofile">
<img class="profile-img" src="https://cdn.blabla/folder/blurr/100x100/content/166634.jpg" alt="">
</a>
Run Code Online (Sandbox Code Playgroud)
我想在网址中更改一个单词.(blurr)in(默认)
<a class="image is-100x100" href="/profile/myprofile">
<img class="profile-img" src="https://cdn.blabla/folder/default/100x100/content/166634.jpg" alt="">
</a>
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
$(function () {
$(".profile-img").html($(".profile-img").html().replace("blurr", "default"));
});
Run Code Online (Sandbox Code Playgroud)
编辑:
我想要一个tapermonkey脚本而不是concole的脚本.