0
import requests

a = 'http://www.wipo.int/branddb/en/?q={"searches":[{"te":"coca%20cola","fi":"BRAND"}]}'

b = requests.get(a)

print(b.text)

Here is a simple webpage. If I paste url in browser and open the link, I get the results I want to see. If I check DOM, I get to see whole html, however if I use python requests, I get more or less nothing. Anybody understand why and how could i solve that?

Testing man
  • 677
  • 1
  • 12
  • 28
  • 1
    What's "more or less nothing"? The specifics would be helpful. – Carcigenicate Apr 19 '17 at 21:22
  • 3
    A majority of the content appears to be dynamically loaded through ajax, which requests does not handle. Try [selenium](http://stackoverflow.com/questions/17540971/how-to-use-selenium-with-python) – Wondercricket Apr 19 '17 at 21:25
  • Sorry guys, yes content is completely different. IT has to do something with Ajax... Any clue how to solve that? A lot of data is missing. EDITED: O.K. I will try with Selenium – Testing man Apr 19 '17 at 21:26
  • @Testingman you might start with my [old answer to the same problem](http://stackoverflow.com/a/34474093/3552063). That was for R, but resolution is exactly the same - you either reverse-engineer their API and use it directly, or you hook into running browser that takes care of loading dynamic content for you. – Mirek Długosz Apr 19 '17 at 21:43
  • Miroslaw, thank you. May I just ask how do i reverse-enigneer of their api? Thanks – Testing man Apr 20 '17 at 10:23

1 Answers1

0

Did you try to use space instead of '%20' here?

felixc
  • 168
  • 2
  • 11