Instapy: Invalid Like Element

Created on 14 Jul 2020  路  11Comments  路  Source: timgrossmann/InstaPy

Expected Behavior

Liking images

Current Behavior

When liking images --> Invalid Like Element ! error

Possible Solution (optional)

**I performed the following changes:

updated InstaPy to the current version - no change

researched previous errors and updated xpath and nothing has resolved it.**

InstaPy configuration

Can be provided if needed.

Most helpful comment

IG changed HTML code

try next to do:

In the file xpath_compile.py change:

xpath["like_image"] = { "like": "//section/span/button/span[@aria-label='Like']"

to Absolute path >

xpath["like_image"] = { "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Like']"

It's working for me. For now...

This works, thanks! But you have to edit to

xpath["like_image"] = { "like": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Like']", "unlike": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Unlike']", }

All 11 comments

same

Currently debugging this one as well using the docker image.

i'm having this same issue

INFO [2020-07-14 22:16:13] [Anyaogu_peter] --> Invalid Like Element!

Same here, I have also updated Instapy and tried a handful of xpath changes from previous issues' solutions, nothing worked. Been like this for 24h now, IG must have changed something, help us out guys

IG changed HTML code

try next to do:

In the file xpath_compile.py change:

xpath["like_image"] = { "like": "//section/span/button/span[@aria-label='Like']"

to Absolute path >

xpath["like_image"] = { "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Like']"

It's working for me. For now...

IG changed HTML code

try next to do:

In the file xpath_compile.py change:

xpath["like_image"] = { "like": "//section/span/button/span[@aria-label='Like']"

to Absolute path >

xpath["like_image"] = { "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Like']"

It's working for me. For now...

This works, thanks! But you have to edit to

xpath["like_image"] = { "like": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Like']", "unlike": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Unlike']", }

This works! Thanks for the help!

IG changed HTML code
try next to do:
In the file xpath_compile.py change:
xpath["like_image"] = { "like": "//section/span/button/span[@aria-label='Like']"
to Absolute path >
xpath["like_image"] = { "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Like']"
It's working for me. For now...

This works, thanks! But you have to edit to

xpath["like_image"] = { "like": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Like']", "unlike": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Unlike']", }

Still working for you, guys? i tried that but get the same error :/

yeah, still working for me.

IG changed HTML code
try next to do:
In the file xpath_compile.py change:
xpath["like_image"] = { "like": "//section/span/button/span[@aria-label='Like']"
to Absolute path >
xpath["like_image"] = { "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Like']"
It's working for me. For now...

This works, thanks! But you have to edit to

xpath["like_image"] = { "like": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Like']", "unlike": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Unlike']", }

Yes...
I thought it was intuitive. Thanks for completing the answer =D

Guys i has been changed like this, but it throw error :
selenium.common.exceptions.ElementClickInterceptedException: Message: Element <div class="">is not clickable at point (735,558) because another element <a class="gKAyB Wn8y-" href="/accounts/activity/">

IG changed HTML code
try next to do:
In the file xpath_compile.py change:
xpath["like_image"] = { "like": "//section/span/button/span[@aria-label='Like']"
to Absolute path >
xpath["like_image"] = { "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Like']"
It's working for me. For now...

This works, thanks! But you have to edit to

xpath["like_image"] = { "like": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Like']", "unlike": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button/div[*[local-name()='svg']/@aria-label='Unlike']", }

Was this page helpful?
0 / 5 - 0 ratings