Questions tagged [urlparse]

urlparse is used for parsing a URL into components like (addressing scheme, network location, path etc.)

urlparse is module in Python2.7 and renamed to urllib.parse in Python 3

Links:

urlparse

urllib.parse

196 questions
-1
votes
1 answer

How to parse 127.0.0.1:1234

I am trying to parse 127.0.0.1:1234 with urlparse urlparse('127.0.0.1:1234') and it is giving me this result ParseResult(scheme='127.0.0.1', netloc='', path='1234', params='', query='', fragment='') I want 127.0.0.1 in netloc field. How to do…
-1
votes
1 answer

how do i replace multiple parameter value with a new value in urlparse?

I have multiple links www.example.com/abc?file=xxxxxxxxxxxxxxx&url=xxxxxxxxxxxxxxx www.example.com/abc?google=xxxxxxxxxxxxxxx&fb=xxxxxxxxxxxxxxx etc Now i want to change these parameter value to "xxxxxxxxxxxxxxx" how can i do that? all parameters…
-1
votes
1 answer

What is scheme 'c' in urlparse in Python?

I think this is a bug since the documentation does not mention anything about a scheme 'c'. Why does the output of the following code out 'c' ? What is scheme 'c' ? As mentioned before the scheme 'c' does not exist in the documentation. from…
ng.newbie
  • 2,807
  • 3
  • 23
  • 57
-1
votes
1 answer

Displaying value transferred from URL via javascript

I'm having an issue with my codes concerning the transfer of information from one page to another using the url as shown below: window.location.href ="form.html?uname="+uname; The value is displaying in the url box but when I try to display it on…
-1
votes
1 answer

Python -- What is the best practice to append query params to url for API calls

I know this sounds weird at first glance. Let me explain. I have a domain that stays consistent, say https://some.api.endpoint/some/path I have a list of different queries I need to call with it. One way to do it is simple concatenating strings but…
JChao
  • 2,178
  • 5
  • 35
  • 65
-1
votes
1 answer

Python: extract text request from url

I try to extract users requests from url. I try to search answer, but I only find how to parse string. But I have a problem, that I should identify a lot of urls with request and when I try to get string with attribute, attributes with text are…
Petr Petrov
  • 4,090
  • 10
  • 31
  • 68
-1
votes
2 answers

Regular expression in python with urlParse

I have this URL: https://www.yoursite.com/drive/team-real-431/pepe-ozil-R323/anyway-jim-james-hi-bye-hi-321312/;jsessionid=DBDE454034B0EE325FC100112EF2E123.56AC29295781342F53AB242D03EE33 i want to…
parik
  • 2,313
  • 12
  • 39
  • 67
-1
votes
2 answers

Split a URL in Python 2.x

I have a link being parsed in some HTML code as below:- "http://advert.com/go/2/12345/0/http://truelink.com/football/abcde.html?" What I am looking to do is extract the second part of the code commencing with the second occurrence of http: so in…
thefragileomen
  • 1,537
  • 8
  • 24
  • 40
-1
votes
1 answer

Python cannot get url params

I want to get the param of a url that is sent back to the server when the user submits the form. However I get this error AttributeError: 'HTTPServerRequest' object has no attribute 'get' My url is…
user94628
  • 3,641
  • 17
  • 51
  • 88
-2
votes
1 answer

How to replace url parameter using python

import urllib.parse as urlparse url = "http://www.example.com?type=aaaaaaa&type1=bbbbbbb&type2=cccccccc" trigger = ["value1","value2","value3"] parsed = urlparse.urlparse(url) querys = parsed.query.split("&") result = [] for pairs in trigger: …
-2
votes
1 answer

Creating function to parse JSON for particular key, then apply urlparse on its value

I have a JSON that looks something like this: [ { "weburl": "https://google.com/athens", "location": "Greece" }, { "weburl": "https://google.com/rome", "location": "Italy" } ... ] What I want to do is create a…
nm44
  • 45
  • 1
  • 6
-3
votes
1 answer

http.NewRequest in golang converting some charterers to % values

go version go1.8.1 windows/amd64 "net/http" package used to build http request. req, err := http.NewRequest("GET",`http://domain/_api/Web/GetFolderByServerRelativeUrl('` + root_folder_url + `')?$expand=Folders,Files`, nil) Here if I print url it…
vkc
  • 83
  • 1
  • 1
  • 9
-3
votes
1 answer

New array from multidimensional array - url parsing

I have the following URL: myexample.com/?city=Miami and a large array (23k) $e = $_GET["city"]; $myArray = array ( array ("Miami","Florida"), array ("Key West","Florida"), array ("NOLA", "Luisiana"), array ("Baton Rouge","Luisiana") ); I'm…
-3
votes
1 answer

How to parse a URL to fetch it's parameters in groovy?

I am new to groovy scripting and looking on to parse the URL and print it's parameter. This url is : https://www.google.com/?aaa=111&bbb=222&ccc=33&dd=1484088989_b23f248ac6e5d9a9b47475526bb92ee1 How can i fetch dd parameter from the URL? I…
SChopra
  • 1
  • 1
  • 1
  • 1
-3
votes
2 answers

Getting parts of a URL in PHP

How can I extract the following parts using PHP function: The Domain The path without the file The file The file with Extension The file without Extension The scheme The port The query The fragment (add any other that you think would be…
San Ka Ran
  • 156
  • 2
  • 18
1 2 3
13
14