ApkPure icon indicating copy to clipboard operation
ApkPure copied to clipboard

AttributeError: 'NoneType' object has no attribute 'text'

Open imsurajkadam opened this issue 3 years ago • 6 comments

Here's the error message that I am getting when I run the main file.

Traceback (most recent call last): File "d:\Desktop\KODE\POST\ApkPure-master\ApkPure-master\main.py", line 4, in <module> find = api._search("config pubg") File "d:\Desktop\KODE\POST\ApkPure-master\ApkPure-master\apis\api.py", line 19, in _search data = s.search_apk() File "d:\Desktop\KODE\POST\ApkPure-master\ApkPure-master\apis\etc.py", line 39, in search_apk soup = Soup(response.text, "lxml") AttributeError: 'NoneType' object has no attribute 'text'

imsurajkadam avatar May 17 '21 07:05 imsurajkadam

Here's the error message that I am getting when I run the main file.

Traceback (most recent call last): File "d:\Desktop\KODE\POST\ApkPure-master\ApkPure-master\main.py", line 4, in <module> find = api._search("config pubg") File "d:\Desktop\KODE\POST\ApkPure-master\ApkPure-master\apis\api.py", line 19, in _search data = s.search_apk() File "d:\Desktop\KODE\POST\ApkPure-master\ApkPure-master\apis\etc.py", line 39, in search_apk soup = Soup(response.text, "lxml") AttributeError: 'NoneType' object has no attribute 'text'

maybe the website has change their content, i'll check soon and fix it ASAP

Alnyz avatar May 17 '21 08:05 Alnyz

Yess looks like so. Thank you. I will wait for the update.

imsurajkadam avatar May 17 '21 08:05 imsurajkadam

Yess looks like so. Thank you. I will wait for the update.

i just starting look what error in this case, i get same error as you get. i dont know this error happen, even i test only with sort code with requests using GET method to get the content but return same error. i'll learn more about this, i will update ASAP

Alnyz avatar May 17 '21 14:05 Alnyz

Yess looks like so. Thank you. I will wait for the update.

i just starting look what error in this case, i get same error as you get. i dont know this error happen, even i test only with sort code with requests using GET method to get the content but return same error. i'll learn more about this, i will update ASAP

Yeah! I also tried to solve those errors. But they kept getting one after another. Will need to look it backwards.

imsurajkadam avatar May 17 '21 14:05 imsurajkadam

It Looks like the website, using cloudflare protection, that preventing the library from getting the content (i check using directly request to the ApkPure). So Maybe using selenium instead to make the request rather than from python requests library

semarainc avatar May 21 '21 11:05 semarainc

Just change the UserAgent string in config.py to a standard browser agent string, for example:

self.default_header = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0"}

graemen avatar Aug 24 '22 01:08 graemen