<?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 Python code to run hyperlink in the attribute table in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/python-code-to-run-hyperlink-in-the-attribute/m-p/1499529#M85095</link>
    <description>&lt;P&gt;I am using arcpro 3.3 and I have an attribute table with a field with hyperlinks to download files from the internet.&amp;nbsp; Is there a tool or script to run to automatically do this?&lt;/P&gt;</description>
    <pubDate>Sat, 29 Jun 2024 17:43:27 GMT</pubDate>
    <dc:creator>JonPeroff</dc:creator>
    <dc:date>2024-06-29T17:43:27Z</dc:date>
    <item>
      <title>Python code to run hyperlink in the attribute table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-code-to-run-hyperlink-in-the-attribute/m-p/1499529#M85095</link>
      <description>&lt;P&gt;I am using arcpro 3.3 and I have an attribute table with a field with hyperlinks to download files from the internet.&amp;nbsp; Is there a tool or script to run to automatically do this?&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2024 17:43:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-code-to-run-hyperlink-in-the-attribute/m-p/1499529#M85095</guid>
      <dc:creator>JonPeroff</dc:creator>
      <dc:date>2024-06-29T17:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python code to run hyperlink in the attribute table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-code-to-run-hyperlink-in-the-attribute/m-p/1499620#M85105</link>
      <description>&lt;P&gt;Hi Jon,&lt;/P&gt;&lt;P&gt;Are you trying to download every linked item from each row of your table? Or are you trying to format hyperlinks so a pop-up will allow the user to download a selected link?&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 02:14:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-code-to-run-hyperlink-in-the-attribute/m-p/1499620#M85105</guid>
      <dc:creator>BobBooth1</dc:creator>
      <dc:date>2024-07-01T02:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Python code to run hyperlink in the attribute table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-code-to-run-hyperlink-in-the-attribute/m-p/1499865#M85123</link>
      <description>&lt;P&gt;Hi Bob,&lt;/P&gt;&lt;P&gt;Happy Canada Day!&lt;/P&gt;&lt;P&gt;I am trying to download from every linked item in a row.&amp;nbsp; The URL is in one field of the attribute table and there are many rows, too many to download one at a time.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 14:33:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-code-to-run-hyperlink-in-the-attribute/m-p/1499865#M85123</guid>
      <dc:creator>JonPeroff</dc:creator>
      <dc:date>2024-07-01T14:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python code to run hyperlink in the attribute table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-code-to-run-hyperlink-in-the-attribute/m-p/1499913#M85127</link>
      <description>&lt;P&gt;Hi Jon,&lt;/P&gt;&lt;P&gt;Happy Canada Day to you!&lt;/P&gt;&lt;P&gt;So, to do the downloading automatically, I'd use a search cursor to iterate over the table and get the values from the URL field in a list.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/searchcursor-class.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/searchcursor-class.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You could make a list, my_urls, for example, and for each cycle of the search cursor append the URL string to the list.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.w3schools.com/python/python_lists_add.asp" target="_blank"&gt;https://www.w3schools.com/python/python_lists_add.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It would look something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="read_urls_into_list_from_search_cursor.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/108476iF60A92C035A8EEA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="read_urls_into_list_from_search_cursor.png" alt="read_urls_into_list_from_search_cursor.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

# path to table/feature class
fc = r'C:\Geology\OH\OH_geol_poly'

my_urls = []

# Use a search cursor to iterate through the table.
# For each row, get the attribute value in a field, 
# and append it to a list.
with arcpy.da.SearchCursor(fc, 'SRC_URL') as cursor:
    for row in cursor:
        my_urls.append(row[0])

print(my_urls)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you have the URLs as a list, use Python to download them to your preferred location. There's an example here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://towardsdatascience.com/use-python-to-download-multiple-files-or-urls-in-parallel-1759da9d6535" target="_blank"&gt;https://towardsdatascience.com/use-python-to-download-multiple-files-or-urls-in-parallel-1759da9d6535&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 15:42:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-code-to-run-hyperlink-in-the-attribute/m-p/1499913#M85127</guid>
      <dc:creator>BobBooth1</dc:creator>
      <dc:date>2024-07-01T15:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Python code to run hyperlink in the attribute table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-code-to-run-hyperlink-in-the-attribute/m-p/1517701#M86718</link>
      <description>&lt;P&gt;I apologize for the late response.&amp;nbsp; I thought I would get a notification.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did finally get a script to work and it's very similar to yours.&amp;nbsp; So thank you for that.&amp;nbsp; I just need to figure out how to download and mosaic them together in the one script.&amp;nbsp; Another topic for another day!&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 20:13:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-code-to-run-hyperlink-in-the-attribute/m-p/1517701#M86718</guid>
      <dc:creator>JonPeroff</dc:creator>
      <dc:date>2024-08-09T20:13:11Z</dc:date>
    </item>
  </channel>
</rss>

