instapy-quickstart
instapy-quickstart copied to clipboard
Got an issue 'attributeError: 'NoneType' object has no attribute 'get'
here's the full code:
PS C:\Users\a\Desktop> py bot.py
InstaPy Version: 0.6.16
.. .. .. .. .. .. .. .. ._.
Workspace in use: "C:/Users/a/InstaPy"
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
INFO [2022-06-11 19:23:28] [itayabergell] Session started!
oooooooooooooooooooooooooooooooooooooooooooooooooooooo
INFO [2022-06-11 19:23:36] [i] - Cookie file for user '...' loaded...
..................................................................
INFO [2022-06-11 19:24:03] Logged in successfully!
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
INFO [2022-06-11 19:24:03] [i] Saving account progress...
INFO [2022-06-11 19:24:56] [ Failed to get followers count of 'b'...'' ~empty list
INFO [2022-06-11 19:25:46] [] Failed to get following count of 'b'...'' ~empty list
WARNING [2022-06-11 19:25:46] [...] Unable to save account progress, skipping data update
b"'NoneType' object has no attribute 'get'"
Traceback (most recent call last):
File "C:\Users\Desktop\bot.py", line 9, in
Same issue
Same issue
Same issue.
Same issue here. Did you find a solution on that?
Same issue
Same issue
Same here.
Same issue
It seems like the chain of problems starts at this code snippet from util.py:
def get_shared_data(browser):
"""
Get shared data object from page source
Code by schealex
:param browser: The selenium webdriver instance
:return shared_data: Json data from window._sharedData extracted from page source
"""
shared_data = None
soup = BeautifulSoup(browser.page_source, "html.parser")
for text in soup(text=re.compile(r"window._sharedData")):
if re.search("^window._sharedData", text):
shared_data = json.loads(re.search("{.*}", text).group())
break
return shared_data
shared_data is probably None at the end of the function, right? any ideas?
Same issue.
same issues
same here
same issue
I found a workaround in util.py at line 1118:
` def format_number (number) :
formatted_num = number.replace(",", "")
formatted_num = formatted_num.replace("\nfollowers", "")
formatted_num = formatted_num.replace("\nfollowing", "")
formatted_num = re.sub(
r"(k)$", "00" if "." in formatted_num else "000", formatted_num
)
formatted_num = re.sub(
r"(m)$", "00000" if "." in formatted_num else "000000", formatted_num
)
formatted_num = formatted_num.replace(".", "")
return formatted_num
`