Question: Hello I'm starting now in programming and I'm having some problems with Scraping, I'm trying to get all the links in a category with several names, but I'm not getting isolate the cells because there are many with the same name, could someone help me? I will put the picture of my code and the url I want to get.

`

```html
url = 'http://books.toscrape.com/index.html'
reqs = requests.get(url)
if reqs.ok:
    soup = BeautifulSoup(reqs.text, 'html.parser')
    ul = soup.find('ul', {'class': 'nav nav-list'})
    for cells in ul:
        a = cells.find('a')
        link = a['href']
        #print(link)
        [print(str(lis) + '\n\n') for lis in link]
```

=== LINK IMAGE ===

I need to retrieve all urls in (li)

[![enter image description here](https://i.stack.imgur.com/mgSG4.png)](https://i.stack.imgur.com/mgSG4.png)

Answer: 
You configured your client as a typed client and not a named client. No need for the factory.

You should explicitly inject the http client in constructor instead, not the http client factory.

Change your code to this:

```
private readonly HttpClient _httpClient;

public ReService(HttpClient httpClient;) {
    _httpClient = httpClient;
}

public async Task<List<Core.Dtos.Re>> GetReBasedOnIngAsync(string endpoint)
{

    ///Remove this from your code
    var client = _httpClientFactory.CreateClient(); <--- HERE the base URL/Headers are missing

    var request = new HttpRequestMessage
    {
        Method = HttpMethod.Get,
        RequestUri = new Uri(endpoint)
    };
    //////

    using (var response = await _httpClient.GetAsync(endpoint))
    {
        // ...
    }
}

```

And according to last MS documentation only the typed client registration is needed in this case. Fix your startup to this:

```
// services.AddScoped<IReService, ReService>(); //<-- REMOVE. NOT NEEDED
services.AddHttpClient<IReService, ReService>(c => ...

```

But you still can try to add you base address, please add trailing slash ( and let us know if it still works):

```
services.AddHttpClient<IReService, ReService>(c => {
                c.BaseAddress = new Uri("https://sooome-api-endpoint.com/");
                 });

```

if problem still persists I recommend you to try named http clients.
@jack wrote a comment and several guys supported him that this is the right decision, but it is the wrong decision.

AddHttpClient creates a TService service as a Transient service, to which it passes an HttpClient created only for it

Calling first AddTransient, and then AddHttpClient<>, you add 2 implementations of one dependency and only the last added one will be returned

```cs
// Create first dependency
services.AddTransient<HttpService>();

// Create second and last dependency
services.AddHttpClient<HttpService>(client =>
{
    client.BaseAddress = new Uri(baseAdress);
});

```