<?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: How to validate Hyperlinks that point to pdfs in system in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684032#M101892</link>
    <description>&lt;P&gt;If your hyperlinks are actual http:// webserver addresses, it should be straightforward using a Python notebook.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You'd need a hint of ArcPy to access the feature-table, then to iterate over each row.&amp;nbsp; Then use each hyperlink-attribute with a Python library like 'requests' to test the server response.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Something like this AI boilerplate?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import requests

# Set input feature class and URL field name
feature_class = r"C:\Path\To\Your.gdb\FeatureClassName"
url_field = "URL_FieldName"

# Use SearchCursor to iterate over the URL field
with arcpy.da.SearchCursor(feature_class, [url_field]) as cursor:
    for row in cursor:
        url = row[0]
        if url:
            try:
                # Send HTTP GET request
                response = requests.get(url, timeout=5)
                if response.status_code == 200:
                    print(f"Active: {url}")
                else:
                    print(f"Broken ({response.status_code}): {url}")
            except requests.exceptions.RequestException as e:
                print(f"Error: {url} - {e}")&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Feb 2026 16:52:45 GMT</pubDate>
    <dc:creator>D_Atkins</dc:creator>
    <dc:date>2026-02-12T16:52:45Z</dc:date>
    <item>
      <title>How to validate Hyperlinks that point to pdfs in system</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684024#M101891</link>
      <description>&lt;P&gt;Is there a way to validate what hyperlinks work or don't work from a field in the attributes table? I have a field with hyperlinks that direct to pdfs in my system and I have over 3000 segments. Not sure if there's an easier way to check besides going through ever single feature in the attributes table. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Feb 2026 16:34:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684024#M101891</guid>
      <dc:creator>FSD_Main</dc:creator>
      <dc:date>2026-02-12T16:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to validate Hyperlinks that point to pdfs in system</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684032#M101892</link>
      <description>&lt;P&gt;If your hyperlinks are actual http:// webserver addresses, it should be straightforward using a Python notebook.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You'd need a hint of ArcPy to access the feature-table, then to iterate over each row.&amp;nbsp; Then use each hyperlink-attribute with a Python library like 'requests' to test the server response.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Something like this AI boilerplate?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import requests

# Set input feature class and URL field name
feature_class = r"C:\Path\To\Your.gdb\FeatureClassName"
url_field = "URL_FieldName"

# Use SearchCursor to iterate over the URL field
with arcpy.da.SearchCursor(feature_class, [url_field]) as cursor:
    for row in cursor:
        url = row[0]
        if url:
            try:
                # Send HTTP GET request
                response = requests.get(url, timeout=5)
                if response.status_code == 200:
                    print(f"Active: {url}")
                else:
                    print(f"Broken ({response.status_code}): {url}")
            except requests.exceptions.RequestException as e:
                print(f"Error: {url} - {e}")&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Feb 2026 16:52:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684032#M101892</guid>
      <dc:creator>D_Atkins</dc:creator>
      <dc:date>2026-02-12T16:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to validate Hyperlinks that point to pdfs in system</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684039#M101893</link>
      <description>&lt;P&gt;Similarly, if they're just a file path in a text field (this will work with html too but you'll have to do some work to extract the text you care about)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import os

tbl = r"path\to\table"
fields = ["OID@", "LinkField"]
with arcpy.da.SearchCursor(tbl, fields) as cursor:
    for row in cursor:
        # Check if file exists
        if not os.path.exists(row[1]):
            #Print entire row (object id and link)
            arcpy.AddMessage(row)
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 12 Feb 2026 17:10:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684039#M101893</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2026-02-12T17:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to validate Hyperlinks that point to pdfs in system</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684053#M101895</link>
      <description>&lt;P&gt;I'd use Python - you could do it in a Notebook in ArcGIS Pro.&lt;/P&gt;&lt;P&gt;The first step would be to load the unique ID and URLs from the table into a list of tuples:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Get_ID_and_URL.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/148351i849CF39B6F7D00EB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Get_ID_and_URL.png" alt="Get_ID_and_URL.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My data has a key field and a license field. The idea is, get both values, so when you check the URL, if it fails, you can make a list of the features that you need to go back and fix.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

# Define the path to your feature class or table
# Example: r"C:\...\your_geodatabase.gdb\your_feature_class"
# Example: r"C:\...\your_shapefile.shp"
feature_class = "M_Monax_NA"

# Define a list with the names of the fields you want to extract values from
field_name = ["key","license"]

# Use a list comprehension with a SearchCursor to create the list
# The [0] index accesses the first value from the first (and only specified) field and the [1] index accessed the second value in the row tuple
field_values_list = [(row[0], row[1]) for row in arcpy.da.SearchCursor(feature_class, [field_name])]

# Print the resulting list of values
print(field_values_list)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you have the list of tuples of ID and URLs, you can get one to test with.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="get_URL_from_first_tuple_to_test.png" style="width: 444px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/148354iF92B8DC053F77D0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="get_URL_from_first_tuple_to_test.png" alt="get_URL_from_first_tuple_to_test.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The notation field_values_list[0] gets the first pair from the list, and the [1] after that gets the URL (which is the second item, after the key value in the tuple).&lt;/P&gt;&lt;P&gt;This URL in my data didn't work so well as an example, as it didn't have a file name, so I found the equivalent version of that page as&amp;nbsp; plaintext.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="the_URL_to_text_file.png" style="width: 592px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/148355iFA1A9DDE47B27A2B/image-size/large?v=v2&amp;amp;px=999" role="button" title="the_URL_to_text_file.png" alt="the_URL_to_text_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once you have a URL, you can use the requests library to test if there is a file there.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test_file_availability.png" style="width: 807px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/148358i416F467CB193A5E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="test_file_availability.png" alt="test_file_availability.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import requests

def url_file_exists(url: str, timeout: int = 5) -&amp;gt; bool:
    """
    Checks if a file exists and is accessible at a given URL using a HEAD request.
    """
    try:
        # Use HEAD request for efficiency
        response = requests.head(url, timeout=timeout)
        # A status code of 2xx indicates success (e.g., 200 OK)
        return response.status_code // 100 == 2
    except requests.exceptions.RequestException:
        # Catches connection errors, timeouts, etc.
        return False

# Example usage:
url_to_check = otherTest
if url_file_exists(url_to_check):
    print(f"File exists at {url_to_check}")
else:
    print(f"File does not exist or is not accessible at {url_to_check}")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you have the&amp;nbsp;url_file_exists function defined, you can run it in a loop on the list and do things conditionally, depending on whether it found a file or not.&lt;/P&gt;&lt;P&gt;Here I'm adding the bad pairs to another list.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test_add_add_fails_to_badList.png" style="width: 744px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/148359iAF7635EBB70853CD/image-size/large?v=v2&amp;amp;px=999" role="button" title="test_add_add_fails_to_badList.png" alt="test_add_add_fails_to_badList.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Make and empty list to hold the ones that fail the test
BadList = []
# Loop over the list of key,URL pairs
for testPair in field_values_list:
    # grab the URL out of the pair 
    url_to_check = testPair[1]
    if url_file_exists(url_to_check):
        print(f"File exists at {url_to_check}")
    else:
        # Add that pair to the BadList
        BadList.append(testPair)
        print(f"File does not exist or is not accessible at {url_to_check}")&lt;/LI-CODE&gt;&lt;P&gt;You could print the BadList, or write it to a text file or a table. Then you know which ones need to be fixed.&lt;/P&gt;&lt;P&gt;For large numbers of pairs, this may take a while. Also, the process may happen faster than the notebook can keep up, so it might be necessary to add code inside the loop to sleep for a second after each try.&lt;/P&gt;&lt;P&gt;That'll make it take longer, but less risk of a problem.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import time

time.sleep(1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Feb 2026 17:51:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684053#M101895</guid>
      <dc:creator>BobBooth1</dc:creator>
      <dc:date>2026-02-12T17:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to validate Hyperlinks that point to pdfs in system</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684181#M101900</link>
      <description>&lt;P&gt;They are not a web server with a URL it's just a file path here is an example of one&amp;nbsp;T:\gis_fsdG2\fsdG2_layers\Pipe_Insp_Reports\A001-D119.pdf. And I'm not too experienced with Python or ArcPy.... but I'm willing to try and learn. Thank you for the response.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Feb 2026 22:13:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684181#M101900</guid>
      <dc:creator>FSD_Main</dc:creator>
      <dc:date>2026-02-12T22:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to validate Hyperlinks that point to pdfs in system</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684182#M101901</link>
      <description>&lt;P&gt;Thanks! I'll give this a try though I'm not familiar with ArcPy at all.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Feb 2026 22:15:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-validate-hyperlinks-that-point-to-pdfs-in/m-p/1684182#M101901</guid>
      <dc:creator>FSD_Main</dc:creator>
      <dc:date>2026-02-12T22:15:15Z</dc:date>
    </item>
  </channel>
</rss>

