I'm trying to write a python script that retrieves information about publications from ISI Web of Science. I found domoritz's python script wos.py on GitHub. It uses Suds to connect to the ISI Web of Science web service. I've imported it into my python script and I tried this code, following the very brief instructions in the comments:
from wos import *
soap = WokmwsSoapClient()
results = soap.search('Hallam')
I then get an error:
suds.WebFault: Server raised fault: 'line 1:1: unexpected token: Hallam'
I looked through the code in wos.py. Here is the search
function:
def search(self, query):
qparams = {
'databaseID' : 'WOS',
'userQuery' : query,
'queryLanguage' : 'en',
'editions' : [{
'collection' : 'WOS',
'edition' : 'SCI',
},{
'collection' : 'WOS',
'edition' : 'SSCI',
}]
}
rparams = {
'count' : 5, # 1-100
'firstRecord' : 1,
'fields' : [{
'name' : 'Relevance',
'sort' : 'D',
}],
}
return self.client['search'].service.search(qparams, rparams)
I thought maybe query
can't be just a plain python string, as I saw in the WSDL page that userQuery
is actually of type xs:string
. But this page says that userQuery
"Must be a valid WOKQL query statement. This requirement is enforced internally", which makes it seem like I don't have to pass in a special type. Anyway, I tried appending 'xs:string'
to the beginning of query but I got the same error.
Does anybody know the proper way to use this method?
You could try to use the Wos Python Client
that can be install with:
pip install wos
And then you can use it like this:
from wos import WosClient
import wos.utils
with WosClient('JohnDoe', '12345') as client:
print(wos.utils.query(client, 'AU=Knuth Donald'))
You will also have a CLI tool to be used like:
wos -u 'JohnDoe' -p '12345' query 'AU=Knuth Donald'
*DISCLAIMER: I don't work for Web of Science but I am the author of the client. You need to have web services access (which is a paid service in addition to the normal WOS access) since Web of Science does not allow web services requests coming from normal users. You should ask your university to provide you with the username and password that WOS gave them. This is not just for my client but for anything that uses WOS web service. *
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With