Skip to content

Commit 26fef18

Browse files
authored
fix instagram behavior (#98)
- update selectors - simplify: iterate over all posts, instead of per row - bump to 0.8.5
1 parent b4b7147 commit 26fef18

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "browsertrix-behaviors",
3-
"version": "0.8.4",
3+
"version": "0.8.5",
44
"main": "index.js",
55
"author": "Webrecorder Software",
66
"license": "AGPL-3.0-or-later",

src/site/instagram.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const Q = {
44
rootPath: "//main/div/div[2]/div",
55
childMatchSelect: "string(.//a[starts-with(@href, '/')]/@href)",
66
childMatch: "child::div[.//a[@href='$1']]",
7-
firstPostInRow: "div[1]/a",
8-
postCloseButton: "/html/body/div[last()]/div[1]/button[.//*[@aria-label]]",
7+
firstPostInRow: "div[1]//a",
8+
postCloseButton: "//div[last() - 2]//div[@role='button']",
99
nextPost: "//button[.//*[local-name() = 'svg' and @aria-label='Next']]",
1010
postLoading: "//*[@aria-label='Loading...']",
1111
subpostNextOnlyChevron,
@@ -194,9 +194,9 @@ export class InstagramPostsBehavior {
194194

195195
async* iterPosts(ctx, next) {
196196
const { getState, sleep, waitUnit, xpathNode } = ctx.Lib;
197-
let count = 0;
197+
//let count = 0;
198198

199-
while (next && ++count <= 3) {
199+
while (next) {
200200
next.click();
201201
await sleep(waitUnit * 10);
202202

0 commit comments

Comments
 (0)