- I am trying to read a geodatabase table into a script.
- Store URLs from Item_URL field into a list
Stuck ok step 2, how can I fix this?
import arcpy
import pandas as pd
from datetime import datetime, timezone
import pandas
import urllib
import http
import sys
# Import the geodatabase table
ItemsURL = "O:\\CheckURLs\\MyProject.gdb\\HubitemCatalogList"
# Select the fields to print
fields = ['Item_URL']
with arcpy.da.SearchCursor(ItemsURL, fields) as cursor:
for i in range(5):
for row in cursor:
print(row)
break
print('Geodatabase table was read in just fine :)')
# Create a list of URLs from Item_URL field
URL_List = []
URL_List = ItemsURL['Item_URL']
Print('List created successfully')
Error:
URL_List = ItemsURL['Item_URL']
TypeError: string indices must be integers