Repository: gautamkrishnar/socli

Issue:
Option to load stack overflow url directly
I use terminal a lot and using googler(jarun/googler) I can get the url of the stack overflow post . It would be good that I could just pass it as a argument to socli and it would open the page

Discussion:
hedythedev: Thank you for your first PR, I will review it shortly. 

CC @gautamkrishnar 
prathampowar2001: Okay will add as soon as possible.
gautamkrishnar: @prathampowar2001 please take your time.
hedythedev: Oh and I think `--open-url` instead of `--open_url` will be better for command line options
hedythedev: The travis tests are failing due to using `namespace.open-url` please update accordingly as to the comments above `open_url`, everything else seems ok. Please also make sure you test your functionalities (`--open-url` with valid/invalid URLs)
hedythedev: I fixed the errors locally and there seemed to be a problem with using `display_results(url_to_use)`:
```
...
File "/mnt/c/Users/hedyh/codeproj/socli/socli/socli.py", line 398, in main
    display_results(url_to_use)
  File "/mnt/c/Users/hedyh/codeproj/socli/socli/printer.py", line 216, in display_results
    question_title, question_desc, question_stats, answers = search.get_question_stats_and_answer(url)
  File "/mnt/c/Users/hedyh/codeproj/socli/socli/search.py", line 120, in get_question_stats_and_answer
    question_title, question_desc, question_stats = get_stats(soup)
  File "/mnt/c/Users/hedyh/codeproj/socli/socli/search.py", line 134, in get_stats
    question_title = (soup.find_all("a", class_="question-hyperlink")[0].get_text())
IndexError: list index out of range
```

Patch:
diff --git a/.gitignore b/.gitignore
index dedeef3..06ff269 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,4 +13,4 @@ build/
 *.egg
 venv
 .eggs
-socli/data.json
\ No newline at end of file
+socli/data.json
diff --git a/README.md b/README.md
index c065580..c8beac2 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# SoCLI ![PyPI](https://img.shields.io/pypi/v/socli) ![PyPI Downloads](https://img.shields.io/pypi/dm/socli) [![Travis Build](https://travis-ci.org/gautamkrishnar/socli.svg?branch=master)](https://travis-ci.org/gautamkrishnar/socli) [![Collaborizm](https://img.shields.io/badge/Collaborizm-Join%20Project-brightgreen.svg)](https://www.collaborizm.com/project/S1cbUui6) [![Gitter Chat](https://badges.gitter.im/socli-community/Lobby.svg)](https://gitter.im/socli-community/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+# SoCLI [![PyPI](https://img.shields.io/pypi/v/socli) ![PyPI Downloads](https://img.shields.io/pypi/dm/socli)](https://pypi.org/project/socli/) [![Travis Build](https://travis-ci.org/gautamkrishnar/socli.svg?branch=master)](https://travis-ci.org/gautamkrishnar/socli) [![Collaborizm](https://img.shields.io/badge/Collaborizm-Join%20Project-brightgreen.svg)](https://www.collaborizm.com/project/S1cbUui6) [![Gitter Chat](https://badges.gitter.im/socli-community/Lobby.svg)](https://gitter.im/socli-community/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
 
 
 Stack Overflow command line written in python. Using SoCLI you can search and browse Stack Overflow without leaving the terminal. Just use the **socli** command:
@@ -99,6 +99,11 @@ If you can't find an answer for your question in Stack Overflow, **socli** allow
 ```sh
 socli -n
 ```
+
+##### Opening a url directly
+If you have the url of the Stack Overflow post then you can pass it using `--open-url` or `-o`.
+For example
+``` socli --open-url https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works```
 
 ### Syntax:
 **socli** has the following syntax
@@ -119,6 +124,8 @@ Usage: socli [ Arguments] < Search Query >
 | -d | --del | Deletes the configuration file generated by socli -u manually. | **socli -d** |
 | -s | --sosearch | SoCLI uses Google search by default to search for questions. To override this and use stackoverflow's default search instead. | **socli -s -q for loop python** |
 | -h | --help | Displays the help text. | **socli --help** |
+| -o | --open-url | Displays the given url in socli if possible if not opens in browser. | **socli -o https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works** |
+
 
 ###### Query
 This term refers to what you're searching for in Stack Overflow.
@@ -184,65 +191,65 @@ Please reach out to any of the following people if you have any queries:
 
 Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
 
-<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
-<!-- prettier-ignore-start -->
-<!-- markdownlint-disable -->
-<table>
-  <tr>
-    <td align="center"><a href="https://github.com/aaxu"><img src="https://avatars2.githubusercontent.com/u/19481525?v=4" width="100px;" alt=""/><br /><sub><b>aaxu</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=aaxu" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/kilbee"><img src="https://avatars1.githubusercontent.com/u/2181891?v=4" width="100px;" alt=""/><br /><sub><b>kilbee</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=kilbee" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/deanWombourne"><img src="https://avatars1.githubusercontent.com/u/7887119?v=4" width="100px;" alt=""/><br /><sub><b>Sam Dean</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=deanWombourne" title="Documentation">📖</a></td>
-    <td align="center"><a href="https://github.com/mwwynne"><img src="https://avatars1.githubusercontent.com/u/3174043?v=4" width="100px;" alt=""/><br /><sub><b>mwwynne</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=mwwynne" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/cpu82"><img src="https://avatars2.githubusercontent.com/u/4080230?v=4" width="100px;" alt=""/><br /><sub><b>Carlos J. Puga Medina</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/issues?q=author%3Acpu82" title="Bug reports">🐛</a></td>
-    <td align="center"><a href="http://jlericson.com/"><img src="https://avatars1.githubusercontent.com/u/1520759?v=4" width="100px;" alt=""/><br /><sub><b>Jon Ericson</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=jericson" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/kumarankit0411"><img src="https://avatars2.githubusercontent.com/u/19763730?v=4" width="100px;" alt=""/><br /><sub><b>Ankit Kr. Singh</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=kumarankit0411" title="Code">💻</a></td>
-  </tr>
-  <tr>
-    <td align="center"><a href="https://alvaharsha.com/"><img src="https://avatars2.githubusercontent.com/u/11926689?v=4" width="100px;" alt=""/><br /><sub><b>Harsha Alva</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=aharshac" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/piamancini"><img src="https://avatars2.githubusercontent.com/u/3671070?v=4" width="100px;" alt=""/><br /><sub><b>Pia Mancini</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=piamancini" title="Documentation">📖</a></td>
-    <td align="center"><a href="https://github.com/adityatandon007"><img src="https://avatars2.githubusercontent.com/u/25108385?v=4" width="100px;" alt=""/><br /><sub><b>Aditya Tandon</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/issues?q=author%3Aadityatandon007" title="Bug reports">🐛</a></td>
-    <td align="center"><a href="https://github.com/Aksh77"><img src="https://avatars0.githubusercontent.com/u/12583292?v=4" width="100px;" alt=""/><br /><sub><b>Akshatha Nayak</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=Aksh77" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/liamhawkins"><img src="https://avatars3.githubusercontent.com/u/22647996?v=4" width="100px;" alt=""/><br /><sub><b>Liam Hawkins</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=liamhawkins" title="Code">💻</a></td>
-    <td align="center"><a href="http://arount.info/"><img src="https://avatars3.githubusercontent.com/u/4593141?v=4" width="100px;" alt=""/><br /><sub><b>Arount</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=arount" title="Code">💻</a></td>
-    <td align="center"><a href="https://breakpoint.purrfect.fr/"><img src="https://avatars3.githubusercontent.com/u/4958985?v=4" width="100px;" alt=""/><br /><sub><b>Cédric Picard</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/issues?q=author%3Acym13" title="Bug reports">🐛</a></td>
-  </tr>
-  <tr>
-    <td align="center"><a href="https://github.com/amartyaamp"><img src="https://avatars1.githubusercontent.com/u/7647235?v=4" width="100px;" alt=""/><br /><sub><b>Amartya Chaudhuri</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=amartyaamp" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/elliott-beach"><img src="https://avatars1.githubusercontent.com/u/13651458?v=4" width="100px;" alt=""/><br /><sub><b>Elliott Beach</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=elliott-beach" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/prashantchahal26"><img src="https://avatars3.githubusercontent.com/u/14841072?v=4" width="100px;" alt=""/><br /><sub><b>Prashant Chahal</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=prashantchahal26" title="Code">💻</a></td>
-    <td align="center"><a href="https://insiyaa.github.io/"><img src="https://avatars2.githubusercontent.com/u/29259374?v=4" width="100px;" alt=""/><br /><sub><b>Insiyah Hajoori</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=Insiyaa" title="Code">💻</a></td>
-    <td align="center"><a href="https://thevirtuoso1973.github.io/"><img src="https://avatars2.githubusercontent.com/u/46009390?v=4" width="100px;" alt=""/><br /><sub><b>C</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=thevirtuoso1973" title="Code">💻</a></td>
-    <td align="center"><a href="https://liambyrne.nz/"><img src="https://avatars2.githubusercontent.com/u/18452094?v=4" width="100px;" alt=""/><br /><sub><b>Liam Byrne</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=liambyrnenz" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/tranchikhang"><img src="https://avatars3.githubusercontent.com/u/16659747?v=4" width="100px;" alt=""/><br /><sub><b>Tran Chi Khang</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=tranchikhang" title="Code">💻</a></td>
-  </tr>
-  <tr>
-    <td align="center"><a href="https://github.com/AlexPoulsen"><img src="https://avatars1.githubusercontent.com/u/9259671?v=4" width="100px;" alt=""/><br /><sub><b>Alix Poulsen</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=AlexPoulsen" title="Documentation">📖</a></td>
-    <td align="center"><a href="https://gitlab.com/albalitz"><img src="https://avatars1.githubusercontent.com/u/9308749?v=4" width="100px;" alt=""/><br /><sub><b>albalitz</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=albalitz" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/anirudnits"><img src="https://avatars3.githubusercontent.com/u/25305301?v=4" width="100px;" alt=""/><br /><sub><b>Aniruddha Bhattacharjee</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=anirudnits" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/dstjacques"><img src="https://avatars0.githubusercontent.com/u/735244?v=4" width="100px;" alt=""/><br /><sub><b>Daniel St.Jacques</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=dstjacques" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/donnell794"><img src="https://avatars2.githubusercontent.com/u/11854190?v=4" width="100px;" alt=""/><br /><sub><b>Donnell Muse</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=donnell794" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/jm66"><img src="https://avatars2.githubusercontent.com/u/2047620?v=4" width="100px;" alt=""/><br /><sub><b>JM Lopez</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=jm66" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/jophab"><img src="https://avatars3.githubusercontent.com/u/13940974?v=4" width="100px;" alt=""/><br /><sub><b>JOBIN PHILIP ABRAHAM</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=jophab" title="Documentation">📖</a></td>
-  </tr>
-  <tr>
-    <td align="center"><a href="https://github.com/jkukul"><img src="https://avatars2.githubusercontent.com/u/7057316?v=4" width="100px;" alt=""/><br /><sub><b>Jakub Kukul</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=jkukul" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/LuckyPigeon"><img src="https://avatars0.githubusercontent.com/u/32315294?v=4" width="100px;" alt=""/><br /><sub><b>Pigeon</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=LuckyPigeon" title="Documentation">📖</a></td>
-    <td align="center"><a href="https://github.com/therajdeepbiswas"><img src="https://avatars2.githubusercontent.com/u/32306614?v=4" width="100px;" alt=""/><br /><sub><b>Rajdeep Biswas</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=therajdeepbiswas" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/sk364"><img src="https://avatars1.githubusercontent.com/u/15685616?v=4" width="100px;" alt=""/><br /><sub><b>Sachin Kukreja</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=sk364" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/simon3270"><img src="https://avatars3.githubusercontent.com/u/1138498?v=4" width="100px;" alt=""/><br /><sub><b>Simon Reap</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=simon3270" title="Code">💻</a></td>
-    <td align="center"><a href="https://stackoverflow.com/users/8709791/srig?tab=profile"><img src="https://avatars1.githubusercontent.com/u/32685230?v=4" width="100px;" alt=""/><br /><sub><b>Srisaila</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=srigalibe" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/agarwalnishtha"><img src="https://avatars0.githubusercontent.com/u/35678934?v=4" width="100px;" alt=""/><br /><sub><b>agarwalnishtha</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=agarwalnishtha" title="Code">💻</a></td>
-  </tr>
-  <tr>
-    <td align="center"><a href="https://github.com/fredkozlowski"><img src="https://avatars0.githubusercontent.com/u/15177661?v=4" width="100px;" alt=""/><br /><sub><b>Frederick Kozlowski</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=fredkozlowski" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/elath03"><img src="https://avatars2.githubusercontent.com/u/20517890?v=4" width="100px;" alt=""/><br /><sub><b>Esha Lath</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=elath03" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/thumpri"><img src="https://avatars2.githubusercontent.com/u/30461824?v=4" width="100px;" alt=""/><br /><sub><b>thumpri</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=thumpri" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/adamjyz"><img src="https://avatars1.githubusercontent.com/u/55098065?v=4" width="100px;" alt=""/><br /><sub><b>Adam Zhang</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=adamjyz" title="Code">💻</a></td>
-  </tr>
-</table>
-
-<!-- markdownlint-enable -->
-<!-- prettier-ignore-end -->
+<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
+<!-- prettier-ignore-start -->
+<!-- markdownlint-disable -->
+<table>
+  <tr>
+    <td align="center"><a href="https://github.com/aaxu"><img src="https://avatars2.githubusercontent.com/u/19481525?v=4" width="100px;" alt=""/><br /><sub><b>aaxu</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=aaxu" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/kilbee"><img src="https://avatars1.githubusercontent.com/u/2181891?v=4" width="100px;" alt=""/><br /><sub><b>kilbee</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=kilbee" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/deanWombourne"><img src="https://avatars1.githubusercontent.com/u/7887119?v=4" width="100px;" alt=""/><br /><sub><b>Sam Dean</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=deanWombourne" title="Documentation">📖</a></td>
+    <td align="center"><a href="https://github.com/mwwynne"><img src="https://avatars1.githubusercontent.com/u/3174043?v=4" width="100px;" alt=""/><br /><sub><b>mwwynne</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=mwwynne" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/cpu82"><img src="https://avatars2.githubusercontent.com/u/4080230?v=4" width="100px;" alt=""/><br /><sub><b>Carlos J. Puga Medina</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/issues?q=author%3Acpu82" title="Bug reports">🐛</a></td>
+    <td align="center"><a href="http://jlericson.com/"><img src="https://avatars1.githubusercontent.com/u/1520759?v=4" width="100px;" alt=""/><br /><sub><b>Jon Ericson</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=jericson" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/kumarankit0411"><img src="https://avatars2.githubusercontent.com/u/19763730?v=4" width="100px;" alt=""/><br /><sub><b>Ankit Kr. Singh</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=kumarankit0411" title="Code">💻</a></td>
+  </tr>
+  <tr>
+    <td align="center"><a href="https://alvaharsha.com/"><img src="https://avatars2.githubusercontent.com/u/11926689?v=4" width="100px;" alt=""/><br /><sub><b>Harsha Alva</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=aharshac" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/piamancini"><img src="https://avatars2.githubusercontent.com/u/3671070?v=4" width="100px;" alt=""/><br /><sub><b>Pia Mancini</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=piamancini" title="Documentation">📖</a></td>
+    <td align="center"><a href="https://github.com/adityatandon007"><img src="https://avatars2.githubusercontent.com/u/25108385?v=4" width="100px;" alt=""/><br /><sub><b>Aditya Tandon</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/issues?q=author%3Aadityatandon007" title="Bug reports">🐛</a></td>
+    <td align="center"><a href="https://github.com/Aksh77"><img src="https://avatars0.githubusercontent.com/u/12583292?v=4" width="100px;" alt=""/><br /><sub><b>Akshatha Nayak</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=Aksh77" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/liamhawkins"><img src="https://avatars3.githubusercontent.com/u/22647996?v=4" width="100px;" alt=""/><br /><sub><b>Liam Hawkins</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=liamhawkins" title="Code">💻</a></td>
+    <td align="center"><a href="http://arount.info/"><img src="https://avatars3.githubusercontent.com/u/4593141?v=4" width="100px;" alt=""/><br /><sub><b>Arount</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=arount" title="Code">💻</a></td>
+    <td align="center"><a href="https://breakpoint.purrfect.fr/"><img src="https://avatars3.githubusercontent.com/u/4958985?v=4" width="100px;" alt=""/><br /><sub><b>Cédric Picard</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/issues?q=author%3Acym13" title="Bug reports">🐛</a></td>
+  </tr>
+  <tr>
+    <td align="center"><a href="https://github.com/amartyaamp"><img src="https://avatars1.githubusercontent.com/u/7647235?v=4" width="100px;" alt=""/><br /><sub><b>Amartya Chaudhuri</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=amartyaamp" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/elliott-beach"><img src="https://avatars1.githubusercontent.com/u/13651458?v=4" width="100px;" alt=""/><br /><sub><b>Elliott Beach</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=elliott-beach" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/prashantchahal26"><img src="https://avatars3.githubusercontent.com/u/14841072?v=4" width="100px;" alt=""/><br /><sub><b>Prashant Chahal</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=prashantchahal26" title="Code">💻</a></td>
+    <td align="center"><a href="https://insiyaa.github.io/"><img src="https://avatars2.githubusercontent.com/u/29259374?v=4" width="100px;" alt=""/><br /><sub><b>Insiyah Hajoori</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=Insiyaa" title="Code">💻</a></td>
+    <td align="center"><a href="https://thevirtuoso1973.github.io/"><img src="https://avatars2.githubusercontent.com/u/46009390?v=4" width="100px;" alt=""/><br /><sub><b>C</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=thevirtuoso1973" title="Code">💻</a></td>
+    <td align="center"><a href="https://liambyrne.nz/"><img src="https://avatars2.githubusercontent.com/u/18452094?v=4" width="100px;" alt=""/><br /><sub><b>Liam Byrne</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=liambyrnenz" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/tranchikhang"><img src="https://avatars3.githubusercontent.com/u/16659747?v=4" width="100px;" alt=""/><br /><sub><b>Tran Chi Khang</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=tranchikhang" title="Code">💻</a></td>
+  </tr>
+  <tr>
+    <td align="center"><a href="https://github.com/AlexPoulsen"><img src="https://avatars1.githubusercontent.com/u/9259671?v=4" width="100px;" alt=""/><br /><sub><b>Alix Poulsen</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=AlexPoulsen" title="Documentation">📖</a></td>
+    <td align="center"><a href="https://gitlab.com/albalitz"><img src="https://avatars1.githubusercontent.com/u/9308749?v=4" width="100px;" alt=""/><br /><sub><b>albalitz</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=albalitz" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/anirudnits"><img src="https://avatars3.githubusercontent.com/u/25305301?v=4" width="100px;" alt=""/><br /><sub><b>Aniruddha Bhattacharjee</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=anirudnits" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/dstjacques"><img src="https://avatars0.githubusercontent.com/u/735244?v=4" width="100px;" alt=""/><br /><sub><b>Daniel St.Jacques</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=dstjacques" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/donnell794"><img src="https://avatars2.githubusercontent.com/u/11854190?v=4" width="100px;" alt=""/><br /><sub><b>Donnell Muse</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=donnell794" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/jm66"><img src="https://avatars2.githubusercontent.com/u/2047620?v=4" width="100px;" alt=""/><br /><sub><b>JM Lopez</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=jm66" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/jophab"><img src="https://avatars3.githubusercontent.com/u/13940974?v=4" width="100px;" alt=""/><br /><sub><b>JOBIN PHILIP ABRAHAM</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=jophab" title="Documentation">📖</a></td>
+  </tr>
+  <tr>
+    <td align="center"><a href="https://github.com/jkukul"><img src="https://avatars2.githubusercontent.com/u/7057316?v=4" width="100px;" alt=""/><br /><sub><b>Jakub Kukul</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=jkukul" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/LuckyPigeon"><img src="https://avatars0.githubusercontent.com/u/32315294?v=4" width="100px;" alt=""/><br /><sub><b>Pigeon</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=LuckyPigeon" title="Documentation">📖</a></td>
+    <td align="center"><a href="https://github.com/therajdeepbiswas"><img src="https://avatars2.githubusercontent.com/u/32306614?v=4" width="100px;" alt=""/><br /><sub><b>Rajdeep Biswas</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=therajdeepbiswas" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/sk364"><img src="https://avatars1.githubusercontent.com/u/15685616?v=4" width="100px;" alt=""/><br /><sub><b>Sachin Kukreja</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=sk364" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/simon3270"><img src="https://avatars3.githubusercontent.com/u/1138498?v=4" width="100px;" alt=""/><br /><sub><b>Simon Reap</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=simon3270" title="Code">💻</a></td>
+    <td align="center"><a href="https://stackoverflow.com/users/8709791/srig?tab=profile"><img src="https://avatars1.githubusercontent.com/u/32685230?v=4" width="100px;" alt=""/><br /><sub><b>Srisaila</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=srigalibe" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/agarwalnishtha"><img src="https://avatars0.githubusercontent.com/u/35678934?v=4" width="100px;" alt=""/><br /><sub><b>agarwalnishtha</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=agarwalnishtha" title="Code">💻</a></td>
+  </tr>
+  <tr>
+    <td align="center"><a href="https://github.com/fredkozlowski"><img src="https://avatars0.githubusercontent.com/u/15177661?v=4" width="100px;" alt=""/><br /><sub><b>Frederick Kozlowski</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=fredkozlowski" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/elath03"><img src="https://avatars2.githubusercontent.com/u/20517890?v=4" width="100px;" alt=""/><br /><sub><b>Esha Lath</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=elath03" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/thumpri"><img src="https://avatars2.githubusercontent.com/u/30461824?v=4" width="100px;" alt=""/><br /><sub><b>thumpri</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=thumpri" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/adamjyz"><img src="https://avatars1.githubusercontent.com/u/55098065?v=4" width="100px;" alt=""/><br /><sub><b>Adam Zhang</b></sub></a><br /><a href="https://github.com/gautamkrishnar/socli/commits?author=adamjyz" title="Code">💻</a></td>
+  </tr>
+</table>
+
+<!-- markdownlint-enable -->
+<!-- prettier-ignore-end -->
 <!-- ALL-CONTRIBUTORS-LIST:END -->
 
 This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
diff --git a/socli/parser.py b/socli/parser.py
index 1fd3a8c..9b5d137 100644
--- a/socli/parser.py
+++ b/socli/parser.py
@@ -60,6 +60,7 @@ def parse_arguments(command):
                                                       "its most voted answer. \n   eg:- socli --res 2 --query "
                                                       "foo bar: Displays the second search result of the query"
                                                       " \"foo bar\"'s most voted answer")
+    parser.add_argument('--open-url' , '-o' , nargs=1 , type=str , help='To load the given url')
     namespace = parser.parse_args(command)
     return namespace
 
diff --git a/socli/printer.py b/socli/printer.py
index cd6ebc6..8a9d543 100644
--- a/socli/printer.py
+++ b/socli/printer.py
@@ -172,7 +172,9 @@ def helpman():
                    " " + bold("--api or -a") + \
                    " : Sets a custom API key for socli" + '\n' + \
                    " " + bold("--sosearch or -s") + \
-                   " : SoCLI uses google search by default. Use this option to search Stack Overflow directly."
+                   " : SoCLI uses google search by default. Use this option to search Stack Overflow directly." + '\n' \
+                   " " + bold("--open-url or -o") + \
+                   " : Opens the given url in socli " +  '\n'
 
     help_text = make_header("\n\n< Search Query >:") + '\n' + \
                "\nQuery to search on Stack Overflow" + '\n' + \
@@ -214,4 +216,4 @@ def display_results(url):
     question_title, question_desc, question_stats, answers = search.get_question_stats_and_answer(url)
     tui.question_post = tui.QuestionPage((answers, question_title, question_desc, question_stats, url))
     tui.MAIN_LOOP = tui.EditedMainLoop(tui.question_post, palette)
-    tui.MAIN_LOOP.run()
\ No newline at end of file
+    tui.MAIN_LOOP.run()
diff --git a/socli/socli.py b/socli/socli.py
index fb8d035..117e66e 100644
--- a/socli/socli.py
+++ b/socli/socli.py
@@ -6,6 +6,7 @@
 """
 
 import os
+import re
 import sys
 import logging
 import requests
@@ -361,7 +362,51 @@ def main():
         search.google_search = False
         tag = namespace.tag
         has_tags()  # Adds tags to StackOverflow url (when not using google search.
-
+    if namespace.open_url:
+        import webbrowser
+        open_in_browser=False
+        display_condition=True
+        url_to_use=namespace.open_url[0]
+        if re.findall(r"^https:\/\/",url_to_use) !=[]:
+            pass
+        else:
+            url_to_use="https://" + url_to_use
+        try:
+            if url_to_use == "https://stackoverflow.com/questions/":
+                raise Exception('URL Error')
+            if url_to_use == "https://www.stackoverflow.com/questions/":
+                raise Exception('URL Error')
+            requests.get(url_to_use)
+        except Exception:
+            printer.print_warning("Error, could be:\n- invalid url\n- url cannot be opened in socli\n- internet connection error")
+            sys.exit(0)
+        nostackoverflow=re.findall(r"stackoverflow\.com",url_to_use)
+        if nostackoverflow == []:
+            open_in_browser=True
+            display_condition=False
+            printer.print_warning("Your url is not a stack overflow url.\nOpening in your browser...")
+        tag_matcher=re.findall(r"\/tag.+\/",url_to_use)
+        blog_matcher=re.findall(r"blog",url_to_use)
+        if tag_matcher != []:
+            extracted_tag=""
+            if re.findall(r"tagged",url_to_use) == []:
+                extracted_tag=re.split(r"\/",url_to_use)[4]
+            else:
+                extracted_tag=re.split(r"\/",url_to_use)[5]
+            open_in_browser=False
+            display_condition=False
+            tag=extracted_tag
+            search.socli_interactive(tag)
+        if blog_matcher != []:
+            open_in_browser=True
+            display_condition=False
+            printer.print_warning("Your url belongs to blog")
+            printer.print_warning("Opening in browser...")
+        if display_condition:
+            open_in_browser=False
+            display_results(url_to_use)
+        if open_in_browser:
+            webbrowser.open(url_to_use)
     if namespace.res is not None:  # If --res flag is present
         # Automatically displays the result specified by the number
         question_number = namespace.res
@@ -396,5 +441,6 @@ def main():
             printer.helpman()
 
 
+
 if __name__ == '__main__':
     main()


Test patch:
diff --git a/socli/tests/test_socli.py b/socli/tests/test_socli.py
index 1ffd8ba..ef5bc3c 100644
--- a/socli/tests/test_socli.py
+++ b/socli/tests/test_socli.py
@@ -44,6 +44,7 @@ class TestSoCLI(unittest.TestCase):
         self.assertFalse(namespace.sosearch)
         self.assertFalse(namespace.tag)
         self.assertFalse(namespace.user)
+        self.assertTrue(not namespace.open_url)
 
     def test02_socliParse(self):
         command = "-h".split()
@@ -61,6 +62,7 @@ class TestSoCLI(unittest.TestCase):
         self.assertFalse(namespace.sosearch)
         self.assertFalse(namespace.tag)
         self.assertFalse(namespace.user)
+        self.assertTrue(not namespace.open_url)
 
     def test03_socliParse(self):
         command = "-iq python for loop".split()
@@ -78,6 +80,7 @@ class TestSoCLI(unittest.TestCase):
         self.assertFalse(namespace.sosearch)
         self.assertFalse(namespace.tag)
         self.assertFalse(namespace.user)
+        self.assertTrue(not namespace.open_url)
 
     def test04_userJSON(self):
         try:
@@ -118,6 +121,23 @@ class TestSoCLI(unittest.TestCase):
         except Exception:
             raise SoCLITestingException("Search SO stats test failed.")
 
+    def test08_socliParse(self):
+        command = "--open-url https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works ".split()
+        namespace = _socli.parse_arguments(command)
+
+        self.assertFalse(namespace.api)
+        self.assertTrue(namespace.browse == [])
+        self.assertFalse(namespace.debug)
+        self.assertFalse(namespace.delete)
+        self.assertFalse(namespace.help)
+        self.assertFalse(namespace.interactive)
+        self.assertFalse(namespace.new)
+        self.assertTrue(namespace.query == [])
+        self.assertFalse(namespace.res)
+        self.assertFalse(namespace.sosearch)
+        self.assertFalse(namespace.tag)
+        self.assertFalse(namespace.user)
+        self.assertTrue(namespace.open_url!=[])
 
 class SoCLITestingException(Exception):