Alnyz / ApkPure

search & download app using python
MIT License
26 stars 5 forks source link

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

Open imsurajkadam opened 3 years ago

imsurajkadam commented 3 years ago

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'

Alnyz commented 3 years ago

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

imsurajkadam commented 3 years ago

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

Alnyz commented 3 years ago

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

imsurajkadam commented 3 years ago

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.

semarainc commented 3 years ago

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

graemen commented 1 year ago

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"}