I use a module called scholarly.py
https://pypi.org/project/scholarly/
It works perfectly, but I cannot store the output from my query into any variable
Here is an exemplary case (same as in the website)
publication=scholarly.search_pubs_query('Perception of physical stability and center of mass of 3D objects')
To access the result I must use print(next('variable'))
print(next(publication))
###output
{'_filled': False,
'bib': {'abstract': 'Humans can judge from vision alone whether an object is '
'physically stable or not. Such judgments allow observers '
'to predict the physical behavior of objects, and hence '
'to guide their motor actions. We investigated the visual '
'estimation of physical stability of 3-D objects (shown '
'in stereoscopically viewed rendered scenes) and how it '
'relates to visual estimates of their center of mass '
'(COM). In Experiment 1, observers viewed an object near '
'the edge of a table and adjusted its tilt to the '
'perceived critical angle, ie, the tilt angle at which '
'the object …',
'author': 'SA Cholewiak and RW Fleming and M Singh',
'eprint': 'https://jov.arvojournals.org/article.aspx?articleID=2213254',
'title': 'Perception of physical stability and center of mass of 3-D '
'objects',
'url': 'https://jov.arvojournals.org/article.aspx?articleID=2213254'},
'citedby': 15,
'id_scholarcitedby': '15736880631888070187',
'source': 'scholar',
'url_scholarbib': 'https://scholar.googleusercontent.com/scholar.bib?q=info:K8ZpoI6hZNoJ:scholar.google.com/&output=citation&scisig=AAGBfm0AAAAAXIjCFpwk1u0XEARPUufLltWIPwQg4_P_&scisf=4&ct=citation&cd=0&hl=en'}
However, when it comes to JSON, it still doesn't work:
json.load(publication)
Traceback (most recent call last):
File "<ipython-input-43-a51cc3f613b0>", line 1, in <module>
json.load(publication)
File "C:\ProgramData\Anaconda3\lib\json\__init__.py", line 293, in load
return loads(fp.read(),
AttributeError: 'generator' object has no attribute 'read'
I tried to use other means such as
[How to make a class JSON serializable
And the result is:
AttributeError: 'generator' object has no attribute 'dict'
Don't know what else to do...