<?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: I have an attribute that hyperlinks to a url.  I can get the url from the attribute table. How do I get python to open / go to the url location? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/i-have-an-attribute-that-hyperlinks-to-a-url-i-can/m-p/518402#M40608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Earl:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to open the below hyperlink / url in a web browser.&amp;nbsp; The web browser takes a few seconds to open up, but it does open and goes to the right url (study # 397) .&amp;nbsp; Note: urllink value was captured using row.getValue(urlfield)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# OPENS A HYPERLINK&lt;/P&gt;&lt;P&gt;import webbrowser&lt;BR /&gt;webbrowser.open(urllink)&amp;nbsp; #&amp;nbsp;&lt;A class="link-bare" href="https://marinecadastre.gov/espis/#/search/study/397" title="https://marinecadastre.gov/espis/#/search/study/397"&gt;https://marinecadastre.gov/espis/#/search/study/397&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Oct 2019 23:53:17 GMT</pubDate>
    <dc:creator>GailMorrison</dc:creator>
    <dc:date>2019-10-17T23:53:17Z</dc:date>
    <item>
      <title>I have an attribute that hyperlinks to a url.  I can get the url from the attribute table. How do I get python to open / go to the url location?</title>
      <link>https://community.esri.com/t5/python-questions/i-have-an-attribute-that-hyperlinks-to-a-url-i-can/m-p/518398#M40604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a feature class that has 700+ records in the attribute table. Each record links to a specific url location.&amp;nbsp; I can get python to extra the unique url (hyperlink).&amp;nbsp; How do I get python to go to the url?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, how do I get the record / row to highlight in the attribute table + zoom to that record (zoom to selected).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx!&lt;/P&gt;&lt;P&gt;Gail&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2019 23:37:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-have-an-attribute-that-hyperlinks-to-a-url-i-can/m-p/518398#M40604</guid>
      <dc:creator>GailMorrison</dc:creator>
      <dc:date>2019-10-16T23:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: I have an attribute that hyperlinks to a url.  I can get the url from the attribute table. How do I get python to open / go to the url location?</title>
      <link>https://community.esri.com/t5/python-questions/i-have-an-attribute-that-hyperlinks-to-a-url-i-can/m-p/518399#M40605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gail,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you clarify what you mean by "go to the url" ? Are you trying to get the text from page or do you want to load the url in a web browser?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the second part, you can use &lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/select-layer-by-attribute.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/select-layer-by-attribute.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Select Layer By Attribute—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;and then use &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;zoomToSelectedFeatures&lt;/SPAN&gt;. Below is a sample for ArcMap:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'/path/to/mxd'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
df &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListDataFrames&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Layers"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
lyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Target_Layer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; df&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;' "id" = 1234 '&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
df&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;zoomToSelectedFeatures&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Earl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:36:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-have-an-attribute-that-hyperlinks-to-a-url-i-can/m-p/518399#M40605</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2021-12-11T22:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: I have an attribute that hyperlinks to a url.  I can get the url from the attribute table. How do I get python to open / go to the url location?</title>
      <link>https://community.esri.com/t5/python-questions/i-have-an-attribute-that-hyperlinks-to-a-url-i-can/m-p/518400#M40606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Earl. Thx for the Select info. Much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like the python script to open the url.&amp;nbsp; The url links to a specific location - example:&amp;nbsp;&amp;nbsp;&lt;A class="link-bare" href="https://marinecadastre.gov/espis/#/search/study/322" title="https://marinecadastre.gov/espis/#/search/study/322"&gt;https://marinecadastre.gov/espis/#/search/study/322&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I get the script to automatically open this url?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2019 16:38:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-have-an-attribute-that-hyperlinks-to-a-url-i-can/m-p/518400#M40606</guid>
      <dc:creator>GailMorrison</dc:creator>
      <dc:date>2019-10-17T16:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: I have an attribute that hyperlinks to a url.  I can get the url from the attribute table. How do I get python to open / go to the url location?</title>
      <link>https://community.esri.com/t5/python-questions/i-have-an-attribute-that-hyperlinks-to-a-url-i-can/m-p/518401#M40607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gail,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still not sure&amp;nbsp;what you mean by open, but I'll assume you mean to open in a browser. For something like that, you could use &lt;A class="link-titled" href="https://pypi.org/project/selenium/" title="https://pypi.org/project/selenium/"&gt;selenium · PyPI&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Earl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2019 16:58:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-have-an-attribute-that-hyperlinks-to-a-url-i-can/m-p/518401#M40607</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2019-10-17T16:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: I have an attribute that hyperlinks to a url.  I can get the url from the attribute table. How do I get python to open / go to the url location?</title>
      <link>https://community.esri.com/t5/python-questions/i-have-an-attribute-that-hyperlinks-to-a-url-i-can/m-p/518402#M40608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Earl:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to open the below hyperlink / url in a web browser.&amp;nbsp; The web browser takes a few seconds to open up, but it does open and goes to the right url (study # 397) .&amp;nbsp; Note: urllink value was captured using row.getValue(urlfield)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# OPENS A HYPERLINK&lt;/P&gt;&lt;P&gt;import webbrowser&lt;BR /&gt;webbrowser.open(urllink)&amp;nbsp; #&amp;nbsp;&lt;A class="link-bare" href="https://marinecadastre.gov/espis/#/search/study/397" title="https://marinecadastre.gov/espis/#/search/study/397"&gt;https://marinecadastre.gov/espis/#/search/study/397&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2019 23:53:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-have-an-attribute-that-hyperlinks-to-a-url-i-can/m-p/518402#M40608</guid>
      <dc:creator>GailMorrison</dc:creator>
      <dc:date>2019-10-17T23:53:17Z</dc:date>
    </item>
  </channel>
</rss>

