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: 
Okay so I will answer my post because with the suggested TYPED way of doing it was causing problems with the values not being set inside the httpClient, E.G BaseAddress was always null.

In the startup I was trying to go with typed httpclient e.g

```cs
services.AddHttpClient<IReService, ReService>(c => ...

```

But instead of doing that, I choose the to go with the Named client. Which means that in the startup we need to register the httpclient like this

```cs
services.AddHttpClient("recipeService", c => {
....

```

And then in the service itself I used HttpClientFactory like below.

```cs
 private readonly IHttpClientFactory _httpClientFactory;

        public RecipeService(IHttpClientFactory httpClientFactory)
        {
            _httpClientFactory = httpClientFactory;
        }

        public async Task<List<Core.Dtos.Recipes>> GetRecipeBasedOnIngredientsAsync(string recipeEndpoint)
        {
            var client = _httpClientFactory.CreateClient("recipeService");

            using (var response = await client.GetAsync(client.BaseAddress + recipeEndpoint))
            {
                response.EnsureSuccessStatusCode();

                var responseRecipies = await response.Content.ReadAsStringAsync();
                var recipeObj = ConvertResponseToObjectList<Core.Dtos.Recipes>(responseRecipies);

                return recipeObj ?? null;
            }
        }

```
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.