<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Store URLs from a field into a list using arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/store-urls-from-a-field-into-a-list-using-arcpy/m-p/1417084#M70496</link>
    <description>&lt;P&gt;Right now, you're asking it to return an index from the string&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;O:\\CheckURLs\\MyProject.gdb\\HubitemCatalogList"&lt;/LI-CODE&gt;&lt;P&gt;So like, ItemsURL[0] would return"O". This is not what you're trying to do.&lt;/P&gt;&lt;P&gt;Try this instead?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Basically, bring the URL_List up and then append each value into it as you iterate over the rows.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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']
URL_List = []
with arcpy.da.SearchCursor(ItemsURL, fields) as cursor:
    for i in range(5):
        for row in cursor:
            print(row)
            # Add the Item_URL value to the list.
            URL_List.append(row[0])
            break
    print('Geodatabase table was read in just fine :)')    
print('List created successfully')
print(URL_List)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2024 15:46:41 GMT</pubDate>
    <dc:creator>AlfredBaldenweck</dc:creator>
    <dc:date>2024-04-30T15:46:41Z</dc:date>
    <item>
      <title>Store URLs from a field into a list using arcpy</title>
      <link>https://community.esri.com/t5/python-questions/store-urls-from-a-field-into-a-list-using-arcpy/m-p/1417077#M70495</link>
      <description>&lt;UL&gt;&lt;LI&gt;I am trying to read a geodatabase table into a script.&lt;/LI&gt;&lt;LI&gt;Store URLs from Item_URL field into a list&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Stuck ok step 2, how can I fix this?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;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')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;LI-CODE lang="c"&gt; URL_List = ItemsURL['Item_URL']
TypeError: string indices must be integers&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 15:41:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/store-urls-from-a-field-into-a-list-using-arcpy/m-p/1417077#M70495</guid>
      <dc:creator>Ed_</dc:creator>
      <dc:date>2024-04-30T15:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Store URLs from a field into a list using arcpy</title>
      <link>https://community.esri.com/t5/python-questions/store-urls-from-a-field-into-a-list-using-arcpy/m-p/1417084#M70496</link>
      <description>&lt;P&gt;Right now, you're asking it to return an index from the string&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;O:\\CheckURLs\\MyProject.gdb\\HubitemCatalogList"&lt;/LI-CODE&gt;&lt;P&gt;So like, ItemsURL[0] would return"O". This is not what you're trying to do.&lt;/P&gt;&lt;P&gt;Try this instead?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Basically, bring the URL_List up and then append each value into it as you iterate over the rows.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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']
URL_List = []
with arcpy.da.SearchCursor(ItemsURL, fields) as cursor:
    for i in range(5):
        for row in cursor:
            print(row)
            # Add the Item_URL value to the list.
            URL_List.append(row[0])
            break
    print('Geodatabase table was read in just fine :)')    
print('List created successfully')
print(URL_List)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 15:46:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/store-urls-from-a-field-into-a-list-using-arcpy/m-p/1417084#M70496</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2024-04-30T15:46:41Z</dc:date>
    </item>
  </channel>
</rss>

