parkerhancock / patent_client

A collection of ORM-style clients to public patent data
Other
92 stars 35 forks source link

when the result of querying patft only match 1 patent, it will throw a exception #51

Closed grimmer0125 closed 2 years ago

grimmer0125 commented 3 years ago

This is copied from https://github.com/parkerhancock/patent_client/issues/45#issuecomment-848458539 and just afarid that you did not notice this.

I tried the same query condition on patft and there is only one search result. The special thing is that it will automatically redirect to the patent page. If using a python script to query, the result is a small html page contains single document this word and the patent URL listed inside but it is not the predicted result page. Therefore, it will throw an exception here

            self.num_results = int(soup.find_all("i")[1].find_all("strong")[-1].text)

I made some workaround code here which is not beautiful and just as a reference, https://github.com/grimmer0125/patent_client/commit/8943ca970d174ecf8aad10669a95ceddd75f5e13#diff-b6dbafaca666db361cb7b2b2266719b822e2dcecd53671c5f29dcf92a6590799R158

parkerhancock commented 3 years ago

Looking into this now. Thanks!

parkerhancock commented 2 years ago

Resolved by #59 . Thanks for the bug report! Sorry it took ages to address!