Q: How can I search for certain data with get requests then make it able to be read? I'm having trouble finding a way to use a get request then transfer the data to something able to be read. How can I go about this?
I tried parsing it with json module but it wouldn't work.
import requests
import tkinter as tk


root = tk.Tk()

response = requests.get("https://en.wikipedia.org/wiki/Python_(programming_language)")


tk.Label(root, text = response.content).pack()



root.mainloop()


C:\Users\Zeke\PycharmProjects\PYTHON1\venv\Scripts\python.exe C:/Users/Zeke/PycharmProjects/PYTHON1/AYAY.py
Traceback (most recent call last):
  File "C:/Users/Zeke/PycharmProjects/PYTHON1/AYAY.py", line 10, in <module>
    parsed = json.loads(response.content)
  File "C:\Users\Zeke\AppData\Local\Programs\Python\Python37-32\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "C:\Users\Zeke\AppData\Local\Programs\Python\Python37-32\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\Zeke\AppData\Local\Programs\Python\Python37-32\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Process finished with exit code 1


A: I don't know anything about Tkinter, but apparently tk.Label() tries to parse it's argument to JSON while the result you're feeding it with is just HTML.
To verify this, you could exchange your line 7 with this:
response = requests.get("https://the-one-api.herokuapp.com/v1/book/5cf5805fb53e011a64671582")
This public endpoint should give you a valid JSON string, which can be parsed.
I don't know what you are trying to achieve with your overall app. If the URL you are requesting in your code is just arbitrary and for testing, fine, change it to one that produces JSON. If not, research on how to extract the parts of the page you need & parse them into JSON.
After all, the problem in your code is not that the value of the response can not be read, it is just not the format you are (or the parsing method you are handing it to is) expecting it to be. ;)

A: You have to use BeautifulSoup (or similar modules like lxml) to search data in HTML. 
Getting data from HTML is called "web scraping" or "screen scraping".

This code displays "Multi-paradigm: functional, imperative, object-oriented, reflective" and it needs some work to get it. But it can get data from all elements on page, not only <table>.
import requests
from bs4 import BeautifulSoup as BS
import tkinter as tk

r = requests.get("https://en.wikipedia.org/wiki/Python_(programming_language)")
soup = BS(r.text, 'html.parser')

first_table = soup.find('table')
all_trs = first_table.find_all('tr')
all_tds = all_trs[1].find_all('td')
item = all_tds[0].text
print(item)

# --- GUI ---

root = tk.Tk()

tk.Label(root, text=item).pack()

root.mainloop()


If intersting data are in <table> then it can be easier to get it with pandas.read_html() which gets all tables and gives list of dataframes.
This code displays also "Multi-paradigm: functional, imperative, object-oriented, reflective" but it needs less work. But it can't get data which are not in <table>.
import pandas as pd
import tkinter as tk

all_tables = pd.read_html("https://en.wikipedia.org/wiki/Python_(programming_language)")

df = all_tables[0] 
item = df.iloc[1,1]
print(item)

# --- GUI ---

root = tk.Tk()

tk.Label(root, text=item).pack()

root.mainloop()


There is more work when page uses JavaScripr to add elements on page because requests, BeautifulSoup and pandas can't run JavaScript. You would need Selenium to control real web browser which can run JavaScript.
