novitae / igbloks Goto Github PK
View Code? Open in Web Editor NEW๐งฑ A library to work with instagram `bloks` technology
๐งฑ A library to work with instagram `bloks` technology
from igbloks.html import bloks_to_html
import json
from bs4 import BeautifulSoup
file_path = r"C:\Users\Administrator\Downloads\igbloks-main\blocks.json"
with open(file_path, "r") as read:
tree = json.load(read)["layout"]["bloks_payload"]["tree"]
htmled = bloks_to_html(tree)
soup = BeautifulSoup()
dj = soup.find("bk.components.text", {"text": "Date joined"})
dj.parent.find_all("bk.components.text")[-1]["text"]
error
Traceback (most recent call last):
File "c:\Users\Administrator\Downloads\igbloks-main\test.py", line 6, in
tree = json.load(read)["layout"]["bloks_payload"]["tree"]
^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\json_init_.py", line 293, in load
return loads(fp.read(),
^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
how to fix it ?
Some bkid
are different but their key mapping is the same than others. As an example, iOS ones and Android ones are charging at each versions, but their keys are always the same (those silly Chinese chars).
bkid
available, and linking them between each others.to_python
function will be called with a bkid
, we will see if it is a "root" one, otherwise we will look for its "root" identical one to call. This will avoid retyping countless times the same fields aliases for same objects.Implementing the recursive search of elements in the tree
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.