The error indicates a problem parsing the wikipedia page with the drug information on it. Does this occur for all results or just for some? Can you give me an example of a search term that causes this to occur so that I can reproduce it?
The solution is probably a putting try: except: around the whole section which would leave the preview blank, but at least not throw an exception. Not all drugs have a wikipedia page and some have one, but without the infobox that the lens is parsing. This is an unavoidable drawback of using a freely editable source for data.
The error indicates a problem parsing the wikipedia page with the drug information on it. Does this occur for all results or just for some? Can you give me an example of a search term that causes this to occur so that I can reproduce it?
The solution is probably a putting try: except: around the whole section which would leave the preview blank, but at least not throw an exception. Not all drugs have a wikipedia page and some have one, but without the infobox that the lens is parsing. This is an unavoidable drawback of using a freely editable source for data.