Codex produces invalid URLs

I have just spent some time seeing if I could coax Codex in displaying an image. I even tried prompting with Python that tested resulting codes from web access. Codex appears to be genererating random URL strings. On some of its produced strings, I went into Google search hoping to use some of the same keywords that Codex supplied in its URLs. This resulted in failed searches. I tried T=0 and T>0 Here is the prompt I used:

# display an image of an apple tree on Wikimedia Commons
# test to make sure that the URL is valid
import urllib.request
from PIL import Image

url = 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Garden_apple_tree_in_Nuthurst%2C_West_Sussex%2C_England_1.jpg/1599px-Garden_apple_tree_in_Nuthurst%2C_West_Sussex%2C_England_1.jpg'
status_code = urllib.request.urlopen(url).getcode()
web_site_is_up = status_code == 200
if(web_site_is_up): 
    urllib.request.urlretrieve(url,'img.png')
    img = Image.open('img.png')
    img.show()

# display an image of a sequoia tree on Wikimedia Commons
# test to make sure that the URL is valid
import urllib.request
from PIL import Image

url = 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Sequoia_bush.jpg/1000px-Sequoia_bush.jpg'
status_code = urllib.request.urlopen(url).getcode()
web_site_is_up = status_code == 200
if(web_site_is_up):
    urllib.request.urlretrieve(url,'img.png')
    img = Image.open('img.png')
    img.show()
1 Like