daneads / pypatent

Search for and retrieve US Patent and Trademark Office Patent Data
GNU General Public License v3.0
71 stars 19 forks source link

ConnectionError #2

Closed katelynstenger closed 5 years ago

katelynstenger commented 5 years ago

In July 2018, these two examples worked well: pypatent.search("microsoft) this_patent = patent('http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FPTO%2Fsearch-adv.htm&r=4&p=1&f=G&l=50&d=PTXT&S1=aaa&OS=aaa&RS=aaa')

November 2018 I am receiving the following error: ConnectionError: ('Connection aborted.', TimeoutError(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond', None, 10060, None))

Dependent package meet requirements: Python 3, BeautifulSoup, requests, re

Loved using this package over the summer :) I tried the script from the summer that worked well, but received the same error. Looking for help with connecting to the server. Thank you for your help in advance! Much appreciated! Any suggestions @daneads ?

daneads commented 5 years ago

@katelynstenger I am looking into this, thanks!

daneads commented 5 years ago

@katelynstenger I was able to replicate the connection error. It was an issue with the user-agent.

I released version 1.1.0 which should connect fine. Try updating and let me know if the issue persists.

Upgrade pypatent: pip install pypatent --upgrade

Then try the search again (note the syntax has changed in 1.1.0):

import pypatent
pypatent.Search('microsoft', get_patent_details=False)
katelynstenger commented 5 years ago

@daneads works well! Thank you for your help :)